nginx serving corrupt images

Saint Michael venefax at gmail.com
Thu Feb 23 02:31:43 UTC 2023


how would this line look?
try_files $uri $uri/ /index.html;
and how do set I the error log to the max level for this particular server
{}?
I am not getting any errors in /var/log/nginx/error.log


On Wed, Feb 22, 2023 at 9:28 PM Maxim Dounin <mdounin at mdounin.ru> wrote:

> Hello!
>
> On Wed, Feb 22, 2023 at 07:35:54PM -0500, Saint Michael wrote:
>
> > a) The error does not have a single line.
> > b) restarting does not fix it
> > c) my nginx is no acting as proxy
>
> So it's certainly unrelated to the article about proxying and
> error propagation you've previously linked.
>
> > d) it happened twice and both times I fixed it by turning gzip off,
> > restarting, and back on.
> > e) I also noticed that I requested the image file with wget, get a full
> > HTML file for the whole document, but named as if it were the image file.
> >
> > wget https://x3x.us/index_files/image001.jpg
> > but `stat image001.jpg' showed it was the entire text HTML file.
>
> Your configuration contains:
>
>   try_files $uri $uri/ /index.html;
>
> so returning "/index.html" for all non-existing files is what
> nginx is configured to do.
>
> Are you sure the file you are requesting actually exists?  Is the
> file system with these files local, or it's something distributed
> and/or some network filesystem?  Are files static, or generated
> and/or synced from somewhere?
>
> You may want to try removing the "try_files" directive, so nginx
> will be able to properly respond with 404 on non-existing files,
> and will log errors with details about attempts to request them.
> Such errors will look like:
>
> 2023/02/23 05:16:25 [error] 80125#100117: *1 open() "/path/to/file" failed
> (2: No such file or directory), client: ...
>
> This should help to identify exact files being requested, so
> you'll be able to check them manually, as will contain exact error
> code, so it will be possible to identify various permission
> issues.
>
> Hope this helps.
>
> --
> Maxim Dounin
> http://mdounin.ru/
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> https://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20230222/f0b649f7/attachment-0001.htm>


More information about the nginx mailing list