【发布时间】:2015-06-16 06:04:06
【问题描述】:
我的 REST API 在 2 个不同的实例中(不同的亚马逊盒子)。我前面有 APIAXLE,它工作正常。我想要的是对来自 APIAXLE 的请求进行负载平衡。
如何为此配置 nginx。
现在我已经将nginx配置如下:
upstream apiaxle_cluster {
server 127.0.0.1:3001;
}
server {
listen 8000;
server_name xx.xx.xxx.x;(IP 1st instance)
location /abcd {
proxy_pass http://127.0.0.1:3001;---------------> APIAXLE-PROXY running port
proxy_set_header Host "placesv2.api.localhost";
}
location /oauth {
proxy_pass http://127.0.0.1:2500;-------------->My REST API running port
proxy_set_header Host "placesv2.api.localhost";
}
}
}
如何修改以上配置做负载均衡。 APIAXLE 中是否提供负载平衡??
【问题讨论】: