Nginx开启禅道PATH_INFO,伪静态模式

禅道配置PATH_INFO
禅道添加第一行zentao/www/index.php

$_SERVER['PATH_INFO'] = preg_replace('/index\.php$/', '', $_SERVER['PATH_INFO']);

 

修改禅道zentao/config/my.php

$config->requestType = 'PATH_INFO';

 


​​​​​​​Nginx配置

 

server {
    listen       100;
    server_name  ztt.mychandao.com;
    root   D:/workspace/zentaopms/www;
    index  index.php index.html index.htm;

    location / {
        autoindex on;
        autoindex_exact_size off;
        autoindex_localtime on;

        if (!-e $request_filename){
        rewrite /(.*)$ /index.php/$1 last;
        break;
        }
    }

    location ~ \.php(.*)$ {
        fastcgi_pass   127.0.0.1:9008;
        fastcgi_index  index.php;
        include fastcgi.conf;
        set $path_info "";
        set $real_script_name $fastcgi_script_name;
        if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
            set $real_script_name $1;
            set $path_info $2;
        }
        fastcgi_param  SCRIPT_FILENAME  $document_root$real_script_name;
        fastcgi_param  SCRIPT_NAME $real_script_name;
        fastcgi_param  PATH_INFO $path_info;
    }

    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
        expires      30d;
    }
     
    location ~ .*\.(js|css)?$ {
        expires      1h;
    }
     
    location /favicon.ico {
        access_log off;
    }
}

 


参考:https://blog.csdn.net/u010365335/article/details/89334136

posted @ 2025-04-21 09:01  河北大学-徐小波  阅读(305)  评论(0)    收藏  举报