Nginx serving wrong site
Francis Daly
francis at daoine.org
Mon Jan 8 15:03:48 UTC 2024
On Mon, Jan 08, 2024 at 09:49:23AM -0500, James Read wrote:
> On Mon, 8 Jan 2024, 09:29 Francis Daly, <francis at daoine.org> wrote:
> > On Mon, Jan 08, 2024 at 09:13:38AM -0500, James Read wrote:
Hi there,
> > So I'm going to guess that your "server_name" line is of the
> > form "www.example.com"; and your browser is instead accessing
> > http://example.com; and nginx is returning the content of the
> > default_server for that ip:port instead of this server.
>
> My server_name is of the form "example.com www.example.com;" so I don't
> think that is the problem. Could this be anything to do with dns
> configuration?
Do your nginx logs indicate that the request is being handled by this
nginx instance at all?
If not, maybe DNS is not causing your browser to talk to this server's
IP address.
Do you have any "listen" directives that include specific IP addresses,
instead of just ports? Does your example.com resolve to the address
of the "listen" in this "server{}"; or to the address of the "listen"
in whichever "server{}" is actually being used; or to a different address?
Cheers,
f
--
Francis Daly francis at daoine.org
More information about the nginx
mailing list