Welcome! Log In Create A New Profile

Advanced

Re: nginx upstream source ip address

Francis Daly
November 13, 2016 03:20PM
On Sat, Nov 12, 2016 at 03:25:49AM +0000, Michael Power wrote:

Hi there,

> I have an nginx web server with two ip addresses. I want to connect to two upstream servers, where one upstream is configured to use one of the ip addresses and the other upstream is configured to use the second ip address.
>

I think that you are asking about setting the source address that nginx
should use when it is making a proxy_pass connection to an upstream.

If so: in general, nginx leaves that to the OS to decide. So if you can
set your local routing table such that any traffic to upstream1 comes
from ip1 and traffic to upstream2 comes from ip2, then nginx will Just
Work (as will anything else on your nginx-serving machine).

If you won't do that, then if you have the case where proxy_pass in one
location goes to upstream1 and proxy_pass in another location goes to
upstream2, then proxy_bind (http://nginx.org/r/proxy_bind) can do what
you want.

Cheers,

f
--
Francis Daly francis@daoine.org

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

nginx upstream source ip address

Michael Power November 11, 2016 10:28PM

Re: nginx upstream source ip address

B.R. via nginx November 12, 2016 02:12PM

Re: nginx upstream source ip address

Francis Daly November 13, 2016 03:20PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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