Tristan Griffiths
May 01, 2009 03:00AM
> -----Original Message-----
> From: owner-nginx@sysoev.ru [mailto:owner-nginx@sysoev.ru] On Behalf Of
> Michael Shadle
> Sent: Friday, 1 May 2009 4:33 PM
> To: nginx@sysoev.ru
> Subject: Re: nginx + ip_nonlocal_bind
>
> i thought nginx listened on port 80 by default. couldn't you just not
> explicitly define it?
>
> On Thu, Apr 30, 2009 at 11:26 PM, Tristan Griffiths
> > Greetings.
> >
> > We would like to setup our Nginx instances in a HA pair. Using
> > Heartbeat, we have Nginx listening on virtual addresses on the active
> > server.
> >
> > On the passive server, we cannot get Nginx to start up because those
> > virtual (or floating) address are not configured on the server until
> > Heartbeat detects a failover condition.
> >
> > Is Nginx able to bind to a non-local IP address? We've tried setting
> the
> > ip_nonlocal_bind kernel option with no luck.
> >
> > Some important information:
> >
> > # nginx -v
> > nginx version: nginx/0.7.53
> >
> > Starting nginx: [emerg]: bind() to 213.167.72.152:80 failed (98:
> Address
> > already in use)
> >
> > CentOS 5.3
> >
> > <config>
> > server {
> >    listen 213.167.72.152:80 default;
> > </config>
> >
> > Any other settings we should provide?
> >
> > OT: Many thanks for the excellent software.

Yes, nginx does listen on port 80 by default.

Basically, we are trying to get nginx to listen on an IP address for which the machine does not currently have (non-local).

Say we have a server with IP address 10.1.1.1, we want Nginx bound to IP 192.168.1.1 without complaining.

The idea being that in a failover situation, the IP 192.168.1.1 may end up being assigned to the server by an external process like Heartbeat.

Even the most basic config (below) is not letting nginx start up on the non-local IP.

user nginx;
worker_processes 4;
pid /var/run/nginx.pid;

error_log /var/log/nginx/error.log;

events {
worker_connections 1000;
}


http {
server {
listen 192.168.1.1:80 default;
}
}
Subject Author Posted

nginx + ip_nonlocal_bind

Tristan Griffiths May 01, 2009 02:26AM

Re: nginx + ip_nonlocal_bind

mike May 01, 2009 02:33AM

RE: nginx + ip_nonlocal_bind

Tristan Griffiths May 01, 2009 03:00AM

Re: nginx + ip_nonlocal_bind

mike May 01, 2009 03:18AM

Re: nginx + ip_nonlocal_bind

Igor Sysoev May 01, 2009 02:50AM

RE: nginx + ip_nonlocal_bind

Tristan Griffiths May 01, 2009 03:27AM

Re: nginx + ip_nonlocal_bind

Igor Sysoev May 01, 2009 03:38AM

RE: nginx + ip_nonlocal_bind

Tristan Griffiths May 01, 2009 06:00AM

RE: nginx + ip_nonlocal_bind

Tristan Griffiths May 01, 2009 07:01AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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