Skip to content

Instantly share code, notes, and snippets.

@andydvsn
Last active October 31, 2016 23:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andydvsn/db33967cc229d13190a4bef86d7a54a9 to your computer and use it in GitHub Desktop.
Save andydvsn/db33967cc229d13190a4bef86d7a54a9 to your computer and use it in GitHub Desktop.
server {
listen 80;
listen [::]:80;
server_name YOUR.HOSTNAME.HERE;
root /srv/wiki;
index index.php
client_max_body_size 5m;
client_body_timeout 60;
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite {
rewrite ^/(.*)$ /index.php?title=$1&$args;
}
location ^~ /maintenance/ {
return 403;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
try_files $uri /index.php;
expires max;
log_not_found off;
}
location = /_.gif {
expires max;
empty_gif;
}
location ^~ /cache/ {
deny all;
}
location /dumps {
root /arv/wiki/local;
autoindex on;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment