Francis Daly
December 14, 2020 05:54AM
On Mon, Dec 14, 2020 at 12:45:00PM +0530, Praveen Kumar K S wrote:

Hi there,

> I'm facing issue where if one of the upstream servers is down, nginx going
> to emerg mode with the subjected error.

Generally, nginx does not care if individual IP:ports defined in an
"upstream" are accessible or not.

nginx does care that any hostnames used in "upstream" can be resolved
at nginx-start-time using the system resolver, and will fail with an
error like "host not found in upstream" if one does not resolve.


Are you reporting that nginx stops working when an upstream server is
down; or are you reporting that nginx fails to start when an upstream
server is down?

And if the latter -- does the hostname that you have configured nginx
to talk to, resolve, when the upstream server is down?

> My requirement is, nginx should go down when all of the upstream servers
> are down.
> But when even one of the upstream servers is up, nginx should still serve
> the requests by proxying requests to that one live upstream server.

What you describe in that last sentence is the expected behaviour.

If you are not seeing that -- can you provide a fuller description of
your setup?

If you have unreliable name resolution, you may be able to change your
"upstream" config to use the IP addresses, which would avoid nginx having
to try name resolution.

Cheers,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

nginx: [emerg] host not found in upstream

Praveen Kumar K S December 14, 2020 02:16AM

Re: nginx: [emerg] host not found in upstream

Francis Daly December 14, 2020 05:54AM

Re: nginx: [emerg] host not found in upstream

Praveen Kumar K S December 14, 2020 08:30AM

Re: nginx: [emerg] host not found in upstream

Francis Daly December 14, 2020 04:58PM

Re: nginx: [emerg] host not found in upstream

Praveen Kumar K S December 16, 2020 08:08AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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