nginx 部署多网站

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 删掉;

重启

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