Created
October 31, 2016 14:59
-
-
Save chrisshroba/4a462fe7167b8d10449b7a5b91fadc3e to your computer and use it in GitHub Desktop.
The nginx configuration for wiki.shroba.io
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name wiki.shroba.io w; | |
client_max_body_size 15M; | |
client_body_buffer_size 128k; | |
root /usr/share/nginx/www/wiki; | |
index doku.php; | |
location / { | |
try_files $uri $uri/ @dokuwiki; | |
} | |
location @dokuwiki { | |
rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last; | |
rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last; | |
rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last; | |
rewrite ^/$ /start?do=index last; | |
rewrite ^/(.*) /doku.php?id=$1&$args last; | |
} | |
location ~ ^/(data|conf|bin|inc)/ { | |
deny all; | |
} | |
location ~ \.php$ { | |
try_files $uri $uri/ /doku.php; | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_param REDIRECT_STATUS 200; | |
fastcgi_pass unix:/var/run/php5-fpm.sock; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment