diff options
author | Tharre <tharre3@gmail.com> | 2018-06-15 17:19:24 +0200 |
---|---|---|
committer | Tharre <tharre3@gmail.com> | 2018-06-15 17:19:24 +0200 |
commit | 76a74270c16d916c1bf274ee53d42694874bbf78 (patch) | |
tree | 81810a8d6279cad87963e59e7532bf6cd2be5d12 /roles/cgit/templates/cgit_nginx.conf.j2 | |
parent | c2e93c2370de9a0948b07e5768c7ac572d299c63 (diff) | |
download | infrastructure-76a74270c16d916c1bf274ee53d42694874bbf78.tar.gz infrastructure-76a74270c16d916c1bf274ee53d42694874bbf78.tar.xz infrastructure-76a74270c16d916c1bf274ee53d42694874bbf78.zip |
Add cgit configuration for arch linux
Diffstat (limited to 'roles/cgit/templates/cgit_nginx.conf.j2')
-rw-r--r-- | roles/cgit/templates/cgit_nginx.conf.j2 | 36 |
1 files changed, 36 insertions, 0 deletions
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; + } +} |