Welcome! Log In Create A New Profile

Advanced

Choosing source-address for upstream connections

Bruno Prémont
May 17, 2013 08:58AM
Is there a way to tell nginx to use a specific address when talking to
an upstream?

I would like to do something like:

upstream bla {
server [D0C::1234]:8080 src [D0C::beaf];
server 1.2.3.4:8080 src 1.2.3.5;
server upstream.example.tld src site.example.tld;
}


My system has multiple local addresses and just one of them should be
used to contact the given upstream.


If host-name is provided the source address should be chosen of the
same address family as the upstream address (so it's not necessary to
explicitly state IP addresses and duplicate server entries for IPv4
and IPv6).


It's possible to do it via "src" attribute of routes though it would be
more clean to do it on the application side.
e.g.
ip route add D0C::1234/128 src D0C::beaf ethX
ip route add 1.2.3.4/32 src 1.2.3.5

Bruno

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Choosing source-address for upstream connections

Bruno Prémont May 17, 2013 08:58AM

Re: Choosing source-address for upstream connections

Ruslan Ermilov May 17, 2013 09:18AM

Re: Choosing source-address for upstream connections

Bruno Prémont May 17, 2013 09:28AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 313
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