diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2015-05-31 23:10:53 +0200 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2015-06-07 02:54:00 +0200 |
commit | acb068b4a5af0654d21c2830655b7c6156a2b845 (patch) | |
tree | e39d16f7bfa6c631271a9a5bf5720fdc0ea9f5ca /roles/wiki/files/etc | |
parent | e63885bcc0d46bfe58a32fcfc1d02daae8735929 (diff) |
Configure ikiwiki (website + wiki).
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; + } +} |