server { listen 80 default_server; listen [::]:80 default_server; # Optimized server names server_name servidordebian.org www.servidordebian.org *.servidordebian.org; root /var/www/servidordebian.org; # Add index.php to the list if you are using PHP index doku.php index.php index.html; # Security: deny access to hidden files (like .htaccess) and dirs (like .git) location ~ /\. { access_log off; log_not_found off; deny all; } location ~ ~$ { access_log off; log_not_found off; deny all; } # Optional: No logs for these files location = /favicon.ico { access_log off; log_not_found off; allow all; } location = /robots.txt { access_log off; log_not_found off; allow all; } location / { try_files $uri $uri/ @dokuwiki; } location ~ ^/lib.*\.(gif|png|ico|jpg)$ { expires 30d; } 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 ^/(.*) /doku.php?id=$1 last; } location ~ /(conf|bin|inc)/ { deny all; } location /data/ { internal; } # pass the PHP scripts to FastCGI server location ~ \.php$ { include snippets/fastcgi-php.conf; # # With php5-cgi alone: # fastcgi_pass 127.0.0.1:9000; # # With php5-fpm: fastcgi_pass unix:/var/run/php5-fpm.sock; } }