From 756dc388bedf97b68449e919a6730788f730c7b8 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Thu, 16 Jul 2026 14:39:19 +0200 Subject: 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 --- roles/cgit/templates/cgit.nginx.conf.j2 | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'roles/cgit/templates/cgit.nginx.conf.j2') 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 }}; } } -- cgit v1.2.3