diff options
Diffstat (limited to 'roles/wiki/files/etc')
-rw-r--r-- | roles/wiki/files/etc/nginx/sites-available/website | 42 | ||||
-rw-r--r-- | roles/wiki/files/etc/nginx/sites-available/wiki | 54 |
2 files changed, 96 insertions, 0 deletions
diff --git a/roles/wiki/files/etc/nginx/sites-available/website b/roles/wiki/files/etc/nginx/sites-available/website new file mode 100644 index 0000000..a4abdce --- /dev/null +++ b/roles/wiki/files/etc/nginx/sites-available/website @@ -0,0 +1,42 @@ +server { + listen 80; + listen [::]:80; + + server_name fripost.org; + + access_log /var/log/nginx/access.log; + error_log /var/log/nginx/error.log info; + + return 301 https://$host$request_uri; +} + + +server { + listen 443; + listen [::]:443; + + server_name fripost.org; + + include ssl/config; + # include the intermediate certificate, see + # - https://www.ssllabs.com/ssltest/analyze.html?d=fripost.org + # - http://nginx.org/en/docs/http/configuring_https_servers.html + ssl_certificate /etc/nginx/ssl/fripost.org.chained.pem; + ssl_certificate_key /etc/nginx/ssl/fripost.org.key; + + access_log /var/log/nginx/access.log; + error_log /var/log/nginx/error.log info; + + location / { + try_files $uri $uri/ =404; + index index.html; + root /var/lib/ikiwiki/public_html/fripost-wiki/website; + } + location /static/ { + alias /var/lib/ikiwiki/public_html/fripost-wiki/static/; + } + + location = /ikiwiki.cgi { + return 403; + } +} diff --git a/roles/wiki/files/etc/nginx/sites-available/wiki b/roles/wiki/files/etc/nginx/sites-available/wiki new file mode 100644 index 0000000..304ea1a --- /dev/null +++ b/roles/wiki/files/etc/nginx/sites-available/wiki @@ -0,0 +1,54 @@ +server { + listen 80; + listen [::]:80; + + server_name wiki.fripost.org; + + access_log /var/log/nginx/wiki.access.log; + error_log /var/log/nginx/wiki.error.log info; + + location / { + location ~ ^/website(/.*)?$ { return 302 $scheme://fripost.org$1; } + try_files $uri $uri/ =404; + index index.html; + root /var/lib/ikiwiki/public_html/fripost-wiki; + } + + location = /ikiwiki.cgi { + return 302 https://$host$request_uri; + } +} + + +server { + listen 443; + listen [::]:443; + + server_name wiki.fripost.org; + + include ssl/config; + # include the intermediate certificate, see + # - https://www.ssllabs.com/ssltest/analyze.html?d=wiki.fripost.org + # - http://nginx.org/en/docs/http/configuring_https_servers.html + ssl_certificate /etc/nginx/ssl/fripost.org.chained.pem; + ssl_certificate_key /etc/nginx/ssl/fripost.org.key; + + access_log /var/log/nginx/wiki.access.log; + error_log /var/log/nginx/wiki.error.log info; + + location / { + location ~ ^/website(/.*)?$ { return 302 $scheme://fripost.org$1; } + try_files $uri $uri/ =404; + index index.html; + root /var/lib/ikiwiki/public_html/fripost-wiki; + } + + location = /ikiwiki.cgi { + fastcgi_param DOCUMENT_ROOT /var/lib/ikiwiki/public_html/fripost-wiki; + fastcgi_param SCRIPT_FILENAME /var/lib/ikiwiki/public_html/ikiwiki.cgi; + fastcgi_index ikiwiki.cgi; + include fastcgi/params; + fastcgi_pass unix:/var/run/fcgiwrap.socket; + gzip off; + } +} |