Welcome! Log In Create A New Profile

Advanced

Re: Multiple IP alias to be used with Nginx

May 29, 2009 02:01PM
On Fri, May 29, 2009 at 10:51:10AM -0700, Payam Chychi wrote:

> 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...

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;
...
}


--
Igor Sysoev
http://sysoev.ru/en/
Subject Author Posted

Multiple IP alias to be used with Nginx

Payam Chychi May 29, 2009 01:51PM

Re: Multiple IP alias to be used with Nginx

Igor Sysoev May 29, 2009 02:01PM

Re: Multiple IP alias to be used with Nginx

J May 29, 2009 02:08PM

Re: Multiple IP alias to be used with Nginx

Payam Chychi May 29, 2009 02:23PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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