【发布时间】:2017-12-27 11:57:27
【问题描述】:
我有多个来自 nginx 负载平衡器的上游服务器:
upstream app {
# Make each client IP address stick to the same server
# See http://nginx.org/en/docs/http/load_balancing.html
ip_hash;
# Use IP addresses: see recommendation at https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
server 1.1.1.1:6666; # app-server-a
server 2.2.2.2:6666; # app-server-a
}
现在我通过关闭每个服务器(例如systemctl myapp stop)然后让 nginx 检测服务器已关闭,从而将服务器置于主动/被动配置中。
但是,我希望能够动态更改上游服务器,而无需关闭应用服务器或 nginx OSS。我知道 nginx Plus 的 proprietary upstream_conf module,但我正在使用 nginx OSS。
如何在 nginx OSS 上动态动态重新配置上游服务器?
【问题讨论】:
标签: nginx load-balancing