nginx serving corrupt images

Saint Michael venefax at gmail.com
Thu Feb 23 13:13:54 UTC 2023


Suppose that my default html file forn a location is xyz.html, but there
are hundreds. What is the canonical way to specify that and only that file
for a / {}.


On Thu, Feb 23, 2023, 8:03 AM Maxim Dounin <mdounin at mdounin.ru> wrote:

> Hello!
>
> On Thu, Feb 23, 2023 at 01:32:06PM +0200, Reinis Rozitis wrote:
>
> > > Question:
> > > if I don't have any like inside de
> > > location / {}
> > > how does nginx delivers an html file out of many possibly found in the
> root for the location?
> >
> > There is generally no need to specify location / { .. } if you don't
> provide any specific configuration or behavior for it.
> >
> > Having just:
> >
> > server {
> > root /some/path;
> > }
> >
> > is enough to serve (static) files.
>
> I would rather recommend to always specify at least "location /",
> even if it's empty.
>
> While not specifying any locations mostly works, this causes nginx
> to process requests in the "server location", which was originally
> introduced as a purely technical one.  Trying to process requests
> in it might have various associated bugs.
>
> --
> 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/20230223/f54f63c3/attachment.htm>


More information about the nginx mailing list