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 <mdou...@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@nginx.org > https://mailman.nginx.org/mailman/listinfo/nginx >
_______________________________________________ nginx mailing list nginx@nginx.org https://mailman.nginx.org/mailman/listinfo/nginx