Forum: NGINX Multiple IP alias to be used with Nginx

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
D0a98f6304ff122ac9b487ff8275d8bb?d=identicon&s=25 Payam Chychi (Guest)
on 2009-05-29 20:01
(Received via mailing list)
Hey guys,

had a question for anyone that is utilizing massive amount of ip alise
on *nix* to allow proper ip listening for nginx. I currently have
1x/24 and 1x/23 network that i need nginx to listen for... I also run
independent config files for each unique ip address on the box which
listens for an active ip address/adapter on the server. Ive had to
turn to using ip alise for this function to work properly but its
really a crappy way of doing this (having over 700 ip alise is not
something an admin would want to have) so is there a way to force
nginx to listen to an ip addresses/request that are not active on the
box? I am utilizing a Load balancer in an DSR mode...

Thanks in advance
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-05-29 20:15
(Received via mailing list)
On Fri, May 29, 2009 at 10:51:10AM -0700, Payam Chychi wrote:

> nginx to listen to an ip addresses/request that are not active on the
> box? I am utilizing a Load balancer in an DSR mode...

If you set *:80 and do not set "bind" on listen's, then nginx will
listen
on *:80 only, and will call getsockname() to learn address:

     server {
         listen  80;
         listen  192.168.1.1:80;
         ...
     }

     server {
         listen  192.168.1.2:80;
         ...
     }

     server {
         listen  192.168.1.3:80;
         ...
     }
Fcaa940f447c1c76afb8ee2448ba0461?d=identicon&s=25 Jérôme Loyet (Guest)
on 2009-05-29 20:17
(Received via mailing list)
2009/5/29 Payam Chychi <pchychi@gmail.com>:
> nginx to listen to an ip addresses/request that are not active on the
> box? I am utilizing a Load balancer in an DSR mode...
>

do you mean that on your real server the VIP are not mounted ?

I use a similar architecture with LVS and direct routing (should be
the same as DSR). And on the real server each VIP is mounted on
loopback and the system is told not to respond to ARP request for
loopback interfaces coming on ethernet interface (play with
net/ipv4/conf/*/arp_ignore and
/proc/sys/net/ipv4/conf/*/arp_announce). This way, each real server
has its own VIP and nginx (or other softwares) can listen on them.

hope it helps
D0a98f6304ff122ac9b487ff8275d8bb?d=identicon&s=25 Payam Chychi (Guest)
on 2009-05-29 20:31
(Received via mailing list)
2009/5/29 Jérôme Loyet <jerome@loyet.net>:
>> something an admin would want to have) so is there a way to force
> net/ipv4/conf/*/arp_ignore and
> /proc/sys/net/ipv4/conf/*/arp_announce). This way, each real server
> has its own VIP and nginx (or other softwares) can listen on them.
>
> hope it helps
>
>

Hi,

yep, same concept only on the actual adapter is where im doing this
and simply dropping outbound arp requests...
This topic is locked and can not be replied to.