- Rest API:无状态,根据权重路由。
- 控制台API:webapp 登录有状态,根据IP路由。
nginx.conf
upstream rest_proxy {server localhost:8080 weight=1;server localhost:8081 weight=1;server localhost:8082 weight=1;
}upstream webapp_proxy {ip_hashserver localhost:8080;server localhost:8081;server localhost:8082;
}server {listen 80;location / {proxy_pass http://rest_proxy;proxy_set_header Host $host;}location /camunda {proxy_pass http://webapp_proxy;proxy_set_header Host $host;}
}