环境说明
域名 | IP | 服务 |
---|---|---|
im.sundayle.com | 192.168.1.92 | Nginx反向代理 |
37.im.sundayle.com | 192.168.1.37 | Nginx Web |
47.im.sundayle.com | 192.168.1.47 | Nginx Web |
Nginx反向代理
注意配置
proxy_set_header Host im.sundayle.com; #这里的域名是37、47的,若没配置对应后端域名,返回内容是 如192.168.1.37:80的内容
1 | upstream im.upserver { |
Nginx Web371
2
3
4
5
6
7
8
9
10server {
listen 80;
server_name im.sundayle.com *.im.sundayle.com;
index index.html;
location / {
default_type text/html;
return 200 'hello web37!!!';
}
}
Nginx Web471
2
3
4
5
6
7
8
9
10server {
listen 80;
server_name im.sundayle.com *.im.sundayle.com;
index index.html;
location / {
default_type text/html;
return 200 'hello web47!!!';
}
}