summaryrefslogtreecommitdiffstats
path: root/roles/cgit/templates/cgit.nginx.conf.j2
diff options
context:
space:
mode:
authorAhmed Abdelhalim <[email protected]>2026-07-16 14:39:19 +0200
committerAhmed Abdelhalim <[email protected]>2026-07-16 17:02:52 +0200
commit756dc388bedf97b68449e919a6730788f730c7b8 (patch)
treece823916a242ea9d44194bbaf6da04d1596b935d /roles/cgit/templates/cgit.nginx.conf.j2
parentf79d1d829cdafebb5dbcd658d31ae89f2e53ce73 (diff)
Refactor pve cgit to use generic proxy
This is refactoring the PoC for deploying cgit on pve, to now move to a more standard deployment with dedicated agnonstic proxy role/container
Diffstat (limited to 'roles/cgit/templates/cgit.nginx.conf.j2')
-rw-r--r--roles/cgit/templates/cgit.nginx.conf.j225
1 files changed, 14 insertions, 11 deletions
diff --git a/roles/cgit/templates/cgit.nginx.conf.j2 b/roles/cgit/templates/cgit.nginx.conf.j2
index 14256054..62fa6669 100644
--- a/roles/cgit/templates/cgit.nginx.conf.j2
+++ b/roles/cgit/templates/cgit.nginx.conf.j2
@@ -1,19 +1,22 @@
server {
- listen {{ cgit_port }};
- listen [::]:{{ cgit_port }};
+ listen 80;
+ listen [::]:80;
server_name {{ cgit_hostname }};
- root /usr/share/webapps/cgit;
+ return 301 https://$server_name$request_uri;
+}
+
+server {
+ listen 443 ssl http2;
+ listen [::]:443 ssl http2;
+
+ server_name {{ cgit_hostname }};
- try_files $uri @cgit;
+ ssl_certificate {{ nginx_ssl_certificate }};
+ ssl_certificate_key {{ nginx_ssl_certificate_key }};
- location @cgit {
- fastcgi_pass unix:/run/fcgiwrap/fcgiwrap.sock;
- fastcgi_param SCRIPT_FILENAME /usr/lib/cgit/cgit.cgi;
- fastcgi_param PATH_INFO $uri;
- fastcgi_param QUERY_STRING $args;
- fastcgi_param HTTP_HOST $server_name;
- include fastcgi_params;
+ location / {
+ proxy_pass http://{{ network_ipv4_address }}:{{ cgit_port }};
}
}