讓Nginx支持pathinfo

支持thinkphp等支持PATHINFO模式 

新建www.conf配置一個新的虛擬主機內容,並添加以下內容:

server{
    listen 80;
    server_name www.test.com;
    location / {
        root html/www;
        index index.php index.html index.htm;
    }
    location ~ \.php(.*)$ {
        root html/www;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $1;
        include fastcgi_params;
    }
}

源地址: http://www.yanshiba.com/archives/700

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章