我是在windows上测试,web根目录是G:/Server/data/html/
dokuwiki安装在G:/Server/data/html/wiki/
nginx.conf内容:
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
client_max_body_size 8m;
fastcgi_buffer_size 128k;
fastcgi_buffers 8 128k;
send_timeout 300;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
keepalive_timeout 65;
server_name_in_redirect off;
server_names_hash_bucket_size 128;
server {
listen 80;
server_name localhost;
location / {
root /Server/data/html;
index index.html index.htm index.php;
autoindex on;
if (!-e $request_filename) {
rewrite (.*) /?index.php/$1;
}
}
location ~ \.php$ {
root /Server/data/html;
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;
}
}
#dokuwiki配置开始
server {
server_name localhost;
root /Server/data/html;
location /wiki/(data|conf|bin|inc)/ {
deny all;
}
location /wiki/ {
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$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
}
}
#dokuwiki配置结束
}
注释中关于dokuwiki的配置一个都没生效。
纳闷