<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 8 Jan 2024, 11:34 James Read, <<a href="mailto:jamesread5737@gmail.com">jamesread5737@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 8 Jan 2024, 10:04 Francis Daly, <<a href="mailto:francis@daoine.org" target="_blank" rel="noreferrer">francis@daoine.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, Jan 08, 2024 at 09:49:23AM -0500, James Read wrote:<br>
> On Mon, 8 Jan 2024, 09:29 Francis Daly, <<a href="mailto:francis@daoine.org" rel="noreferrer noreferrer" target="_blank">francis@daoine.org</a>> wrote:<br>
> > On Mon, Jan 08, 2024 at 09:13:38AM -0500, James Read wrote:<br>
<br>
Hi there,<br>
<br>
> > So I'm going to guess that your "server_name" line is of the<br>
> > form "<a href="http://www.example.com" rel="noreferrer noreferrer noreferrer" target="_blank">www.example.com</a>"; and your browser is instead accessing<br>
> > <a href="http://example.com" rel="noreferrer noreferrer noreferrer" target="_blank">http://example.com</a>; and nginx is returning the content of the<br>
> > default_server for that ip:port instead of this server.<br>
> <br>
> My server_name is of the form "<a href="http://example.com" rel="noreferrer noreferrer noreferrer" target="_blank">example.com</a> <a href="http://www.example.com" rel="noreferrer noreferrer noreferrer" target="_blank">www.example.com</a>;" so I don't<br>
> think that is the problem. Could this be anything to do with dns<br>
> configuration?<br>
<br>
Do your nginx logs indicate that the request is being handled by this<br>
nginx instance at all?<br>
<br>
If not, maybe DNS is not causing your browser to talk to this server's<br>
IP address.<br>
<br>The logs look fine. They are showing the requests. <br><br><br>
Do you have any "listen" directives that include specific IP addresses,<br>
instead of just ports? Does your <a href="http://example.com" rel="noreferrer noreferrer noreferrer" target="_blank">example.com</a> resolve to the address<br>
of the "listen" in this "server{}"; or to the address of the "listen"<br>
in whichever "server{}" is actually being used; or to a different address?<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto"><div dir="auto">server {</div><div dir="auto"> listen 80;</div><div dir="auto"> listen [::]:80;</div><div dir="auto"> </div><div dir="auto"> root /var/www/<a href="http://moshiim.it" target="_blank" rel="noreferrer">moshiim.it</a>;</div><div dir="auto"> </div><div dir="auto"> index index.php index.html index.htm index.nginx-debian.html;</div><div dir="auto"> server_name <a href="http://example.com" target="_blank" rel="noreferrer">example.com</a> <a href="http://www.example.com" target="_blank" rel="noreferrer">www.example.com</a>;</div><div dir="auto"> location / {</div><div dir="auto"> </div><div dir="auto"> try_files $uri $uri/ =404;</div><div dir="auto"> }</div><div dir="auto"><br></div><div dir="auto"> location ~ \.php$ {</div><div dir="auto"> include snippets/fastcgi-php.conf;</div><div dir="auto"> fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;</div><div dir="auto"> }</div><div dir="auto"><br></div><div dir="auto">}</div></div><div dir="auto"></div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">OK this is a browser issue and not a nginx issue. I just accessed the site with lynx and it is showing the right site. However with Chrome it is showing the wrong site. This may have something to do with the fact that I had to clear the HSTS cache in the browser in order to be able to see anything. The domain used to have a SSL certificate and Chrome was refusing display because it detected the site had no SSL certificate. I need to figure out how to get Chrome to behave normally. </div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Cheers,<br>
<br>
f<br>
-- <br>
Francis Daly <a href="mailto:francis@daoine.org" rel="noreferrer noreferrer" target="_blank">francis@daoine.org</a><br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" rel="noreferrer noreferrer" target="_blank">nginx@nginx.org</a><br>
<a href="https://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer noreferrer noreferrer" target="_blank">https://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div></div></div>
</blockquote></div></div></div>