Welcome! Log In Create A New Profile

Advanced

Re: Nginx serving wrong site

James Read
January 08, 2024 11:36AM
On Mon, 8 Jan 2024, 10:04 Francis Daly, <francis@daoine.org> wrote:

> On Mon, Jan 08, 2024 at 09:49:23AM -0500, James Read wrote:
> > On Mon, 8 Jan 2024, 09:29 Francis Daly, <francis@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.
>
> The logs look fine. They are showing the requests.
>
>
> 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?
>

server {
listen 80;
listen [::]:80;

root /var/www/moshiim.it;

index index.php index.html index.htm index.nginx-debian.html;
server_name example.com www.example.com;
location / {

try_files $uri $uri/ =404;
}

location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}

}


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

Nginx serving wrong site

James Read January 08, 2024 08:12AM

Re: Nginx serving wrong site

Francis Daly January 08, 2024 08:22AM

Re: Nginx serving wrong site

James Read January 08, 2024 09:16AM

Re: Nginx serving wrong site

Francis Daly January 08, 2024 09:30AM

Re: Nginx serving wrong site

James Read January 08, 2024 09:50AM

Re: Nginx serving wrong site

Francis Daly January 08, 2024 10:04AM

Re: Nginx serving wrong site

James Read January 08, 2024 11:36AM

Re: Nginx serving wrong site

James Read January 08, 2024 11:50AM

Re: Nginx serving wrong site

Francis Daly January 09, 2024 04:34AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 328
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 466 on July 09, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready