首页 > 技术文章 > Nginx虚拟目录支持PHP配置

coffee_cn 2015-02-26 10:55 原文

感谢作者:http://blog.csdn.net/fangaoxin/article/details/7030139

 

    location ~ ^/test/.+\.php$ {
        alias    /var/www/html/test/;
        rewrite    /test/(.*\.php?) /$1 break;
        fastcgi_index    index.php;
        fastcgi_pass    127.0.0.1:9000;
        fastcgi_param    SCRIPT_FILENAME /var/www/html/test$fastcgi_script_name;
        include    fastcgi_params;
    }
    location ~^/test($|/.*) {
        alias    /var/www/html/test/$1;
        index    index.php index.html index.htm;
    }

 

推荐阅读