Welcome! Log In Create A New Profile

Advanced

Re: listen on IPs but do not fail if one is absent - ?

Francis Daly
February 13, 2022 06:26AM
On Sun, Feb 13, 2022 at 07:56:16AM +0000, lejeczek via nginx wrote:
> On 12/02/2022 13:26, Francis Daly wrote:
> > On Sat, Feb 12, 2022 at 10:11:25AM +0000, lejeczek via nginx wrote:

Hi there,

> > > having multiple 'listen' with IPs or, just one 'listen' with a hostname
> > > which resolves to more than one IP - is it possible to tell Nginx not fail
> > > when one of IPs is absent, does not exist?
> > I think that stock nginx does not support that.
> >
> > There are possibly ways to avoid the failure; but they all fundamentally
> > are different ways to do "only bind to locally-existing addresses".

> I can confess I return to Nginx after long many years of a divorce and this
> curious fact - if Nginx cannot do that - will be a surprise to me.

Use cases tend to be addressed when a developer has the incentive to
write the code.

If the feature that you are hoping for, has not been implemented in a
way that you are hoping for, then probably no-one cared enough to ensure
that it was done in that way.

> I thought such a "feature" would be in Nginx by now, if not devised by
> developers than included by popular demand - looking at the options/params
> to 'listen', something like 'remain' or 'insist' which would instruct Nginx
> to start & continue to work and hook onto the IP when/after it appeared(but
> also continue to work after IP disappeared)

As Maxim indicates in the parallel reply: nginx will not fail if it does
not try to bind() to a non-existing address:port.

And you can arrange that, by making sure that your "listen ip:port"
directive does not include any of the parameters that require a bind();
and by making sure that, for each port that you listen on, there is also a
"listen *:port"-equivalent directive somewhere in the config.

So possibly the feature that you want already exists with restrictions
that you are happy to work within?

Cheers,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list -- nginx@nginx.org
To unsubscribe send an email to nginx-leave@nginx.org
Subject Author Posted

listen on IPs but do not fail if one is absent - ?

lejeczek via nginx February 12, 2022 05:16AM

Re: listen on IPs but do not fail if one is absent - ?

Francis Daly February 12, 2022 08:28AM

Re: listen on IPs but do not fail if one is absent - ?

lejeczek via nginx February 13, 2022 03:00AM

Re: listen on IPs but do not fail if one is absent - ?

Francis Daly February 13, 2022 06:26AM

Re: listen on IPs but do not fail if one is absent - ?

lejeczek via nginx August 03, 2022 04:52AM

Re: listen on IPs but do not fail if one is absent - ?

Maxim Dounin August 06, 2022 10:50AM

Re: listen on IPs but do not fail if one is absent - ?

Maxim Dounin February 12, 2022 08:32AM

Re: listen on IPs but do not fail if one is absent - ?

Igor Ippolitov August 03, 2022 05:56AM

Re: listen on IPs but do not fail if one is absent - ?

lejeczek via nginx August 03, 2022 07:06AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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