192.
创新互联是一家专业提供
鼎城企业网站建设,专注与成都做网站、网站建设、
外贸营销网站建设、
H5技术、小程序制作等业务。10年已为鼎城众多企业、政府机构等服务。创新互联专业网站设计公司优惠进行中。168.169.123 8081端口 代理 http://192.168.169.191
192.168.169.123 8082端口 代理 http://192.168.169.192
配置文件:
server{
listen 8081;
server_name localhost;
location /{
# root html;
# index index.html index.html iisstart.htm;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://192.168.169.191/;
}
}
server{
listen 8082;
server_name localhost;
location /{
# root html;
# index index.html index.html iisstart.htm;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://192.168.169.192/;
}
}
负载均衡配置
upstream js {
server 192.168.169.191:80 weight=1;
server 192.168.169.192:80 weight=1;
}
server{
listen 8090;
server_name js;
location / {
proxy_pass http://js;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
upstream js {
server 192.168.169.191:80 weight=1;
server 192.168.169.192:80 weight=1;
}
server{
listen 8090;
server_name js;
location / {
proxy_pass http://js;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
文章标题:nginx代理设置-创新互联
网页链接:
http://kswjz.com/article/doichg.html