我正在尝试使用一个nignx服务器代理在tomcat中运行的多应用程序:
a.example.com ->192.168.1.101:8080/ps and 192.168.1.102:8080/ps
b.example.com ->192.168.1.102:9080/ir
这是我的nginx.conf.It似乎不行。请帮帮我。谢谢
upstream ps {
server 192.168.1.101:8080 weight=2;
server 192.168.1.102:8080 weight=3;
}
upstream ir {
server 192.168.1.102:9080;
}
server {
listen 80;
server_name a.example.com;
location /{
proxy_pass http://ps/ps;
}
}
server{
listen 80;
server_name b.example.com;
location /{
proxy_pass http://ir/ir;
}
}