Yefei.Blog

个人日记 WIKI

用户工具


DokuWiki Nginx 配置

注意下面的 server_name、root、fastcgi_pass 修改成自己的环境

server {
    listen 80;
    server_name youservername;
    charset utf-8;
    root /home/www/doku;
    index index.html index.php;

    location ~ /(data/|conf/|bin/|inc/|install.php) { deny all; }
    location / { 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&$args last;
    }

    location ~ \.php$ {
        try_files $uri $uri/ /doku.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param REDIRECT_STATUS 200;
        fastcgi_pass unix:/tmp/php-fpm.sock;
    }
}

皖ICP备15000265号

皖公网安备 34110302000106号