如何区分不同的⽹站:
1. 域名不同
2. 端⼝不同
第一种方案:通过端⼝区分不同虚拟机
比如:http://localhost:8888 访问 a项目
http://localhost:9999 访问 b项目
具体做法:
修改/usr/local/nginx/conf/nginx.conf
具体的两个Server的配置如下:
server {
listen 8888;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root zp;
index Index.html index.htm;
}
}
另一个server配置如下:
server {
listen 9999;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root oa;
index index.html index.htm;
}
}