From 76a74270c16d916c1bf274ee53d42694874bbf78 Mon Sep 17 00:00:00 2001 From: Tharre Date: Fri, 15 Jun 2018 17:19:24 +0200 Subject: Add cgit configuration for arch linux --- roles/cgit/templates/cgit_nginx.conf.j2 | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 roles/cgit/templates/cgit_nginx.conf.j2 (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 new file mode 100644 index 0000000..365daaf --- /dev/null +++ b/roles/cgit/templates/cgit_nginx.conf.j2 @@ -0,0 +1,36 @@ +# {{ ansible_managed }} + +server { + listen 80; + listen [::]:80; + server_name {{ cgit_subdomain }}; + + include snippets/letsencrypt.conf; + + location / { + return 301 https://$host$request_uri; + } +} + +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + server_name {{ cgit_subdomain }}; + + root /usr/share/webapps/cgit; + index index.html index.htm; + + ssl_certificate /etc/letsencrypt/live/{{ cgit_subdomain }}/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/{{ cgit_subdomain }}/privkey.pem; + ssl_trusted_certificate /etc/letsencrypt/live/{{ cgit_subdomain }}/chain.pem; + + try_files $uri @cgit; + location @cgit { + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root/cgit.cgi; + fastcgi_param PATH_INFO $uri; + fastcgi_param QUERY_STRING $args; + fastcgi_param HTTP_HOST $server_name; + fastcgi_pass unix:/run/fcgiwrap.sock; + } +} -- cgit v1.2.3-70-g09d2