How to find out in which directory the nginx site is looking. The fact is that my site gives out 404. I would like to know in which directory nginx is looking for a site, maybe I messed up a little something, maybe there is an opportunity to debug?

  • Nginx searches in the directory specified in the configuration file. If the file is not located - look at what location it should be processed and what is indicated there. - MANK
  • 2
    see logs. default: /var/log/nginx/access.log and /var/log/nginx/error.log - aleksandr barakin

1 answer 1

If the usual error log (the default /var/log/nginx/error.log , or the required server block specified in the error_log directive) is not enough, you can turn on the debug log, there is VERY much information in it. In particular, it is useful when debugging confusion with location . To enable the debug log, you need to add debug to the error_log directive, like this:

 error_log /path/to/log debug; 

I think it makes no sense to retell the beautiful (and nginx Russian-language documentation: http://nginx.org/ru/docs/debugging_log.html

You may also find this nginx documentation section: http://nginx.org/ru/docs/http/ngx_http_core_module.html#location