Welcome! Log In Create A New Profile

Advanced

Re: How did nginx resolve names?

Francis Daly
March 07, 2021 06:26AM
On Fri, Mar 05, 2021 at 03:09:34PM +0100, basti wrote:

Hi there,

> Today I had the problem, that nginx run into "504 Gateway Time-out" when the
> first nameserver in /etc/resolv.conf did not answer.
>
> The php application is query some names (db-server for example).
>
> Did nginx use nsswitch?

Very roughly: if nginx sees a hostname that matters in the config file,
nginx will use the system resolver at start-up time to turn that into
an IP address, and will never resolve it again.

If nginx instead sees a hostname at request-processing time, it will
use whatever "resolver" was configured in the nginx config file.

http://nginx.org/r/resolver

nginx-at-startup does not use nsswitch directly; it uses your system
resolver, and *that* might use nsswitch -- nginx does not care.

nginx-at-request does not use anything from the system resolver.

And: if the issue is that your php script is doing some name resolution,
then nginx will not be involved in that -- your php will do whatever
your php is configured to do -- probably something that your favourite
search engine will mention when requesting "php hostname resolution".

Cheers,

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

How did nginx resolve names?

basti March 05, 2021 09:10AM

Re: How did nginx resolve names?

Francis Daly March 07, 2021 06:26AM

Re: How did nginx resolve names?

andromeda123 March 09, 2021 08:05PM

Re: How did nginx resolve names?

Francis Daly March 10, 2021 09:16AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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