码迷,mamicode.com
首页 > 其他好文 > 详细

nginx同一iP多域名配置方法

时间:2015-04-20 20:35:47      阅读:131      评论:0      收藏:0      [点我收藏+]

标签:

文章转自:http://blog.itblood.com/nginx-same-ip-multi-domain-configuration.html

下面的是我本机的配置:

server {
        listen 80;
        server_name localhost; #绑定域名
        index index.htm index.html index.php; #默认文件
        root /data/webroot; #网站根目录
        location ~ \.php$ {
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                include fastcgi_params;
        }
        access_log /data/logs/access.log;
        error_log /data/logs/error.log;
}
server {
        listen 80;
        server_name test.localhost; #绑定域名
        index index.htm index.html index.php; #默认文件
        root /data/webroot/testRoot; #网站根目录
                location ~ \.php$ {
                        fastcgi_pass 127.0.0.1:9000;
                        fastcgi_index index.php;
                        include fastcgi_params;
        }
        access_log /data/logs/test_access.log;
        error_log /data/logs/test_error.log;
}

 

nginx同一iP多域名配置方法

标签:

原文地址:http://www.cnblogs.com/wangkongming/p/4442345.html

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