$FHHOME/conf/nginx/dokuwiki.example.com.conf
server {
listen 80;
server_name test1.example.com;
access_log /var/log/nginx/test1.access.log;
error_log /var/log/nginx/test1.error.log;
root /usr/share/nginx/html/test1/dokuwiki;
index index.html index.php doku.php;
#auth_basic "Restricted";
#auth_basic_user_file /etc/nginx/htpasswd;
#maximum file upload size is 4MB - change accordingly if needed
client_max_body_size 4M;
client_body_buffer_size 128k;
rewrite ^(/)_media/(.*) $1lib/exe/fetch.php?media=$2 last;
rewrite ^(/)_detail/(.*) $1lib/exe/detail.php?media=$2 last;
rewrite ^(/)_export/([^/]+)/(.*) $1doku.php?do=export_$2&id=$3 last;
location / {
if (!-f $request_filename) {
rewrite ^(/)(.*)?(.*) $1doku.php?id=$2&$3 last;
rewrite ^(/)$ $1doku.php last;
}
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
location ~ ^/(data|conf|bin|inc)/ {
deny all;
}
location ~ ^/lib/^((?!php).)*$ {
root html/dokuwiki/lib;
expires 30d;
}
}