NGINX Open Source TCP Load Balancing - service discovery
Matthew Ceroni
matthewceroni at gmail.com
Mon Oct 17 21:44:00 UTC 2016
https://www.nginx.com/blog/dns-service-discovery-nginx-plus/
Testing out the options provided in the above link. Specifically the
"Setting the Domain Name in a Variable". The example given is L7 load
balancing.
I have a need for L4 using upstream, yet I am not able to get this method
to work (if it even does). The Note seems to indicate that it does by
stating that this method is available in 1.11.3 of the Open source version.
The issue is around where to set the variable. I have tried setting it in
the upstream block but that errors saying set is not valid in this context.
Tried setting it in the stream context, same error.
I have also tried this on both Plus and open source and get the same errors
on both.
Any insight would be helpful. Thanks
config:
# TCP/UDP proxy and load balancing block
#
stream {
proxy_protocol on;
resolver 10.6.0.10 valid=10s;
# Example configuration for TCP load balancing
upstream stream_backend {
zone tcp_servers 64k;
server backend_servers:25 max_fails=3;
}
server {
listen 25;
status_zone tcp_server;
proxy_pass stream_backend;
}
}
So basically I need to replace server backend_servers with server
$backend_servers but need to set that variable somewhere.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20161017/30eb58a2/attachment.html>
More information about the nginx
mailing list