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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
server {
listen 80;
server_name git.dominic-ricottone.com;
location / {
return 302 https://$server_name$request_uri;
}
location ^~ /.well-known {
root /var/www;
}
location = /robots.txt {
root /var/www;
}
}
server {
listen 443 ssl http2;
gzip on;
gzip_types text/css text/html;
server_name git.dominic-ricottone.com;
ssl_certificate /var/lets-encrypt/inter.lets-encrypt.cert;
ssl_certificate_key /var/lets-encrypt/inter.lets-encrypt.key;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384;
ssl_prefer_server_ciphers on;
client_max_body_size 100M;
location / {
proxy_read_timeout 300s;
proxy_connect_timeout 75s;
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_read_timeout 300s;
proxy_connect_timeout 75s;
proxy_pass http://localhost:5101;
include graphql.conf;
}
location /static {
root /usr/lib/python3.9/site-packages/gitsrht;
expires 30d;
}
location = /authorize {
proxy_read_timeout 300s;
proxy_connect_timeout 75s;
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;
}
location ^~ /.well-known {
root /var/www;
}
location = /robots.txt {
root /var/www;
}
}