~dricottone/huttese

ref: 6476da76a8eeec0a2a48c53eefcaf3eae20c144a huttese/sr/etc/nginx/http.d/git.conf -rw-r--r-- 1.1 KiB
6476da76Dominic Ricottone Refactoring 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
server {
	listen 8080;
	gzip on;
	gzip_types text/css text/html;
	server_name git.intra.dominic-ricottone.com;

	client_max_body_size 100M;

	location / {
		proxy_pass http://localhost:5001;
		include headers.conf;
		add_header Content-Security-Policy "default-src 'none'; style-src 'self' 'unsafe-inline'; img-src * data:; script-src 'self' 'unsafe-inline'" always;
		include web.conf;
	}

	location /query {
		proxy_pass http://localhost:5101;
		include graphql.conf;
	}

	location /static {
		root /usr/lib/python3.9/site-packages/gitsrht;
		expires 30d;
	}

	location = /authorize {
		proxy_pass http://localhost:5001;
		proxy_pass_request_body off;
		proxy_set_header Content-Length "";
		proxy_set_header X-Original-URI $request_uri;
	}

	location ~ ^/([^/]+)/([^/]+)/(HEAD|info/refs|objects/info/.*|git-upload-pack).*$ {
		auth_request /authorize;
		root /var/lib/git;
		fastcgi_pass localhost:9000;
		fastcgi_param SCRIPT_FILENAME /usr/libexec/git-core/git-http-backend;
		fastcgi_param PATH_INFO $uri;
		fastcgi_param GIT_PROJECT_ROOT $document_root;
		fastcgi_read_timeout 500s;
		include fastcgi_params;
		gzip off;
	}
}