worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; server_name localhost; root /usr/share/webapps/dokuwiki; index doku.php; # Remember to comment the below out when you are installing DokuWiki, and uncomment it when you are done. # location ~ /(data/|conf/|bin/|inc/|install.php) { deny all; } # secure Dokuwiki location ~^/\.ht { deny all; } # also secure the Apache .htaccess files location @dokuwiki { #rewrites "doku.php/" out of the URLs if you set the userewrite setting to .htaccess in dokuwiki config page 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 ^/(.*) /doku.php?id=$1&$args last; } location / { try_files $uri $uri/ @dokuwiki; } location ~ \.php$ { try_files $uri =404; fastcgi_pass unix:/run/php-fpm7/php-fpm.sock; fastcgi_index index.php; include fastcgi.conf; } } }