summaryrefslogtreecommitdiffstats
path: root/roles/cgit/templates/cgit.nginx.conf.j2
diff options
context:
space:
mode:
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 }};
}
}