server { listen 80; server_name example.com; access_log /home/www/example.com/logs/access.log; error_log /home/www/example.com/logs/error.log warn; index index.html index.htm; root /home/www/example.com/public_html; location /wiki { root /home/www/; index index.php doku.php index.html index.htm; #Secure DokuWiki location ~ /(data|conf|bin|inc)/ { deny all; } location ~ /(install.php|\.ht) { deny all; } #Serve non-php files directly from NginX location ~ /lib/^((?!php).)*$ { expires 30d; } #Connection with PHP5 FPM location ~ \.php$ { include fastcgi_params; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $uri; } } }