aboutsummaryrefslogtreecommitdiff
path: root/doc/tips
diff options
context:
space:
mode:
authoralexjj <alexjj@web>2016-09-24 00:48:51 -0400
committeradmin <admin@branchable.com>2016-09-24 00:48:51 -0400
commit9eb445c14513a8df3272547ea90b2fe731700094 (patch)
tree7676222aca8dae49ef470db24d3f1504b8f99bfa /doc/tips
parent1e203ac71b56203e2d60568e2f1e92862b8c5f4c (diff)
downloadikiwiki-9eb445c14513a8df3272547ea90b2fe731700094.tar
ikiwiki-9eb445c14513a8df3272547ea90b2fe731700094.tar.gz
Created
Diffstat (limited to 'doc/tips')
-rw-r--r--doc/tips/nginx.mdwn62
1 files changed, 62 insertions, 0 deletions
diff --git a/doc/tips/nginx.mdwn b/doc/tips/nginx.mdwn
new file mode 100644
index 000000000..6e6a409b1
--- /dev/null
+++ b/doc/tips/nginx.mdwn
@@ -0,0 +1,62 @@
+There's a lot of scattered info about nginx. This is what I've deduced from reading various blogs, Debian READMEs and the [nginx wiki](https://www.nginx.com/resources/wiki/start/topics/examples/fcgiwrap/).
+
+For Debian I suggest installing nginx from [dotdeb](https://www.dotdeb.org/instructions/). They provide the latest stable versions.
+
+For cgi install ```fcgiwrap```
+
+Here is a full sites-enabled/example.com configure for hosting ikiwiki on the root domain, example.com:
+
+```
+server {
+ listen 443 default_server;
+ listen [::]:443 ssl default_server;
+ root /home/ikiwiki/public_html/wiki;
+
+ index index.html;
+
+ server_name example.com www.example.com;
+
+ ssl_certificate /etc/nginx/ssl/example.com.pem;
+ ssl_certificate_key /etc/nginx/ssl/example.com.key;
+
+ ssl_session_timeout 5m;
+ ssl_session_cache shared:SSL:50m;
+ ssl_dhparam /etc/nginx/ssl/dhparam.pem;
+ ssl_prefer_server_ciphers on;
+ ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
+ ssl_ciphers "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";
+ resolver 8.8.8.8;
+ ssl_stapling on;
+ ssl_trusted_certificate /etc/nginx/ssl/example.com.pem;
+ add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
+
+ client_max_body_size 10m;
+
+ # ikiwiki site
+
+ location / {
+ try_files $uri $uri/ =404;
+ }
+
+ location ~ .cgi {
+ gzip off;
+ fastcgi_pass unix:/var/run/fcgiwrap.socket;
+ include /etc/nginx/fastcgi_params;
+
+ }
+}
+
+
+##
+#Forward http to https
+##
+
+server {
+ listen 80 default_server;
+ listen [::]:80 default_server;
+ server_name example.com www.example.com;
+ return 301 https://$host$request_uri;
+}
+```
+
+For SSL tips this [gist](https://gist.github.com/plentz/6737338) is a good source of information. Use [letsencrypt](https://letsencrypt.org/) to get free certificates.