aboutsummaryrefslogtreecommitdiff
path: root/roles/cosmos/templates/nginx.conf.j2
diff options
context:
space:
mode:
authorLibravatar Martin Michalec <martin@michalec.dev>2026-10-22 20:28:49 +0000
committerLibravatar Martin Michalec <martin@michalec.dev>2026-10-22 20:28:49 +0000
commit84682c67b65e51be9168bb87d30d31bbd6d614a5 (patch)
tree7bcc1aaa0fdaaf494379d67694007b61462f684a /roles/cosmos/templates/nginx.conf.j2
parentfeat: add private (diff)
downloadinfra-84682c67b65e51be9168bb87d30d31bbd6d614a5.tar.gz
feat: add cgit
Diffstat (limited to 'roles/cosmos/templates/nginx.conf.j2')
-rw-r--r--roles/cosmos/templates/nginx.conf.j245
1 files changed, 45 insertions, 0 deletions
diff --git a/roles/cosmos/templates/nginx.conf.j2 b/roles/cosmos/templates/nginx.conf.j2
index b9b6c67..98879ac 100644
--- a/roles/cosmos/templates/nginx.conf.j2
+++ b/roles/cosmos/templates/nginx.conf.j2
@@ -48,6 +48,51 @@ server {
48} 48}
49 49
50server { 50server {
51 server_name git.cosmos.party;
52
53 listen unix:/var/run/nginx/http.sock;
54 listen 443 ssl;
55 listen [::]:443 ssl;
56 listen 443 quic;
57 listen [::]:443 quic;
58
59 http2 on;
60 http3 on;
61
62 add_header Alt-Svc 'h3=":443"; ma=86400';
63
64 ssl_certificate /etc/ssl/cosmos.party.fullchain.pem;
65 ssl_certificate_key /etc/ssl/private/cosmos.party.key;
66 ssl_protocols TLSv1.2 TLSv1.3;
67
68 location ~ /.+/(info/refs|git-upload-pack) {
69 include /etc/nginx/fastcgi_params;
70 fastcgi_param SCRIPT_FILENAME /usr/libexec/git-core/git-http-backend;
71 fastcgi_param PATH_INFO $uri;
72 fastcgi_param GIT_PROJECT_ROOT /var/lib/git/repositories/;
73 fastcgi_pass unix:/var/run/cgit.sock-1;
74 }
75
76 root /srv/http/git.cosmos.party/;
77 try_files $uri @cgit-static;
78
79 location @cgit-static {
80 root /usr/share/webapps/cgit/;
81 try_files $uri @cgit;
82 }
83
84 location @cgit {
85 include /etc/nginx/fastcgi_params;
86 fastcgi_param SCRIPT_FILENAME /usr/share/webapps/cgit/cgit.cgi;
87 fastcgi_param CGIT_CONFIG /etc/cgitrc-cosmos;
88 fastcgi_param PATH_INFO $uri;
89 fastcgi_param QUERY_STRING $args;
90 fastcgi_param HTTP_HOST $server_name;
91 fastcgi_pass unix:/var/run/cgit.sock-1;
92 }
93}
94
95server {
51 server_name andr.cosmos.party; 96 server_name andr.cosmos.party;
52 97
53 98