Welcome! Log In Create A New Profile

Advanced

NGINX Open Source TCP Load Balancing - service discovery

Matthew Ceroni
October 17, 2016 05:46PM
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.
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

NGINX Open Source TCP Load Balancing - service discovery

Matthew Ceroni October 17, 2016 05:46PM

Re: NGINX Open Source TCP Load Balancing - service discovery

Francis Daly October 18, 2016 03:16AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 304
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready