http-dynamic-upstream #
Changes upstream servers at run time through an HTTP API: list, add, remove or mark down a server without a reload. Use it with service discovery or deploy scripts; the upstream needs a zone directive.
Source: upstream source
Directives
dynamic_upstream #
syntax: dynamic_upstream no args; · context: location
Now ngx_dynamic_upstream supports dynamic upstream under only http context.
Example
upstream backends {
zone zone_for_backends 1m;
server 127.0.0.1:6001;
server 127.0.0.1:6002;
server 127.0.0.1:6003;
}
server {
listen 6000;
location /dynamic {
allow 127.0.0.1;
deny all;
dynamic_upstream;
}
location / {
proxy_pass http://backends;
}
}