aboutsummaryrefslogtreecommitdiff
path: root/roles/cgit/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/cgit/templates/nginx.conf.j2
parentfeat: add private (diff)
downloadinfra-84682c67b65e51be9168bb87d30d31bbd6d614a5.tar.gz
feat: add cgit
Diffstat (limited to 'roles/cgit/templates/nginx.conf.j2')
-rw-r--r--roles/cgit/templates/nginx.conf.j227
1 files changed, 27 insertions, 0 deletions
diff --git a/roles/cgit/templates/nginx.conf.j2 b/roles/cgit/templates/nginx.conf.j2
new file mode 100644
index 0000000..2483471
--- /dev/null
+++ b/roles/cgit/templates/nginx.conf.j2
@@ -0,0 +1,27 @@
1# -*- Nginx -*-
2# {{ ansible_managed }}
3
4server {
5 listen 443 ssl;
6 listen [::]:443 ssl;
7 server_name {{ domain }};
8
9 ssl_certificate /etc/ssl/{{ domain | regex_replace('^git\\.', '') }}.fullchain.pem;
10 ssl_certificate_key /etc/ssl/private/{{ domain | regex_replace('^git\\.', '') }}.key;
11
12 root /usr/share/webapps/cgit/;
13 try_files $uri @cgit_{{ instance }};
14
15 location / {
16 try_files $uri @cgit_{{ instance }};
17 }
18
19 location @cgit_{{ instance }} {
20 include fastcgi_params;
21 fastcgi_param SCRIPT_FILENAME /usr/bin/cgit.cgi;
22 fastcgi_param PATH_INFO $uri;
23 fastcgi_param QUERY_STRING $args;
24 fastcgi_param HTTP_HOST $server_name;
25 fastcgi_pass 127.0.0.1:{{ port }};
26 }
27}