Welcome! Log In Create A New Profile

Advanced

Re: question about not found

February 28, 2019 11:02AM
> On 28 Feb 2019, at 15:53, Maxim Dounin <mdounin@mdounin.ru> wrote:
>
> Hello!
>
> On Thu, Feb 28, 2019 at 03:30:22PM +0200, Christos Chatzaras wrote:
>
>>> On 28 Feb 2019, at 15:06, Christos Chatzaras <chris@cretaforce.gr> wrote:
>>>
>>>> On 28 Feb 2019, at 14:47, Christos Chatzaras <chris@cretaforce.gr> wrote:
>>>>
>>>> If I try to visit an image that doesn't exist I get:
>>>>
>>>> "404 Not Found"
>>>>
>>>> If I add a location / { } then I get:
>>>>
>>>> "File not found"
>>>>
>>>> In both cases using curl -I http://www.example.com/image.png I get:
>>>>
>>>> HTTP/1.1 404 Not Found
>>>> Server: nginx
>>>> Date: Thu, 28 Feb 2019 12:46:56 GMT
>>>> Content-Type: text/html
>>>> Content-Length: 162
>>>> Connection: keep-alive
>>>>
>>>> Any idea why it shows different message?
>>>
>>> The "File not found" message is displayed with Safari. With Curl and Firefox it shows "404 Not Found".
>>>
>>> Does Safari overrides the original message?
>>
>> Finally I think it's related to nginx cache.
>
> The only message generated by nginx itself is "404 Not Found". If
> you see different messages, they are generated elsewhere.
> Depending on your exact configuration, this may be, for example,
> your backend server, the "error_page" you've configured, or your
> client.
>
> Note well that there is a difference between what browser shows
> and what "curl -I" shows. While "curl -I" shows response headers,
> browsers show the response body (or a "friendly" error page from
> the browser itself in some cases). To get something comparable
> with what browsers show you have to use "curl" without "-I".
>
> Also note that browsers cache responses by default, and testing
> configuration changes with browsers might be tricky.
>
> --
> Maxim Dounin
> http://mdounin.ru/

Thank you for the reply.

With fastcgi_intercept_errors enabled I always see the Nginx message.

I am searching now if the "File not found" message is generated from PHP-FPM.
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

question about not found

CyberCr33p February 28, 2019 07:48AM

Re: question about not found

CyberCr33p February 28, 2019 08:08AM

Re: question about not found

CyberCr33p February 28, 2019 08:32AM

Re: question about not found

Maxim Dounin February 28, 2019 08:54AM

Re: question about not found

CyberCr33p February 28, 2019 11:02AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 306
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready