nginx:rewrite_for_dokuwiki


# nginx rewrite for dokuwiki

    server

    {

        listen       80;

        server_name  wiki.dbaman.cn;

        index index.html index.htm index.php;

        root  /www/wiki;



        rewrite ^(/docs/)_media/(.*) $1lib/exe/fetch.php?media=$2 last;

        rewrite ^(/docs/)_detail/(.*) $1lib/exe/detail.php?media=$2 last;

        rewrite ^(/docs/)_export/([^/]+)/(.*) $1doku.php?do=export_$2&id=$3 last;



        # 不允许直接访问/docs/data/

        location /docs/data/ {

            rewrite ^(/docs/)data/.*?$ $1doku.php last;

        }



        location /docs/ {

            if (!-f $request_filename) {

                rewrite ^(/docs/)(.*)?(.*)  $1doku.php?id=$2&$3 last;

                rewrite ^(/docs/)$ $1doku.php last;

            }

        }



        #

        location ~ .*\.(php)?$

        {

            fastcgi_pass  unix:/tmp/php-cgi.sock;

            fastcgi_index index.php;

            include fcgi.conf;

        }



        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$

        {

            expires      15d;

        }



        location ~ .*\.(js|css)?$

        {

            expires      1d;

        }



        #access_log  /server/logs/wiki.access.log  access;

    }

你可能感兴趣的:(nginx,PHP,unix,css,Access)