码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2015-11-21 10:29:36      阅读:123      评论:0      收藏:0      [点我收藏+]

标签:

编辑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;
        }
    }

}

 

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

标签:

原文地址:http://www.cnblogs.com/firadio/p/4982952.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!