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

nginx 部署多网站

时间:2016-05-14 23:14:06      阅读:520      评论:0      收藏:0      [点我收藏+]

标签:

1, www 下面加一个文件夹 abc

 

2,   在default.conf 复制一下 ,abc.conf ,

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
server {
    listen       80 ;
    server_name  abc.9hlh.com;
        index index.html index.htm index.php;
        root /alidata/www/abc;
        location ~ .*\.(php|php5)?$
        {
                fastcgi_pass  127.0.0.1:9000;
                fastcgi_index index.php;
                include fastcgi.conf;
        }
        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
                expires 30d;
        }
        location ~ .*\.(js|css)?$
        {
                expires 1h;
        }
        access_log  /alidata/log/nginx/access/abc.log;
}

 

注意 :

1
listen       80  后面的default 删掉;

 

重启

nginx 部署多网站

标签:

原文地址:http://www.cnblogs.com/aliblogs/p/5493760.html

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