您的位置:首页 > 运维架构 > Nginx

nginx.conf绑定虚拟目录执行PHP

2015-11-21 09:44 543 查看
编辑server.conf文件

server{
listen 127.86.1.88:80;
root /home/www/webbase/apitest.ipaotui.com/wwwroot/;
index index.php;
location /{
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
if ($uri ~ \.php$){
fastcgi_pass   unix:/tmp/php-cgi.sock;
}
}
location /document {
root /home/www/webbase/apitest.ipaotui.com/;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
if ($uri ~ \.php$){
fastcgi_pass   unix:/tmp/php-cgi.sock;
}
}
location /wendang {
if (!-e $request_filename) {
rewrite ^/([0-9a-zA-Z]+)/(.*)$ /document/$2 last;
}
}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: