dokuwiki_nginx
DokuWiki mit nginx
Ich verwende folgende Konfiguration für den nginx-Server um:
- ein URL-Rewirte wie mit Apache .htaccess zu haben und
- das Login auf IPs einzuschränken, da ich immer wieder Bruteforce versuche beobachte und
- das DokuWiki so zu sichern, dass das Backend damit zufrieden ist.
location ~ /(data|conf|bin|inc)/ {
deny all;
}
location ~ /\.ht {
deny all;
}
error_page 418 = @do_login;
location / {
recursive_error_pages on;
if ($arg_do = login) {
return 418;
}
index doku.php;
try_files $uri $uri/ @dokuwiki;
}
location @do_login {
allow x.x.x.x;
deny all;
index doku.php;
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 ^/(.*) /doku.php?id=$1 last;
}
location ~ \.php$
{
fastcgi_pass unix:/var/run/php-wiki.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_param HTTPS on;
}
dokuwiki_nginx.txt · Zuletzt geändert: 2017/03/17 11:37 von 127.0.0.1
