Best practices for solving location issues

classic Classic list List threaded Threaded
2 messages Options
Gbg
Reply | Threaded
Open this post in threaded view
|

Best practices for solving location issues

Gbg
During the last days I spent considerable amount of time solving issues with my location definitions.
Sometimes I could see attempts to open files in the error.log, sometimes not.

I know there is https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/ but wanted to ask if there is a list of best practice troubleshooting advice or even some tool or debugging switch that can help me find out which location gets used for a specific URL or URL pattern
_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: Best practices for solving location issues

Francis Daly
On Mon, Oct 08, 2018 at 09:50:36PM +0200, Gbg wrote:

Hi there,

> wanted to ask if there is a list of best practice troubleshooting
> advice or even some tool or debugging switch that can help me find out
> which location gets used for a specific URL or URL pattern

The debug log (http://nginx.org/en/docs/debugging_log.html) holds lots
of information.

For testing, a limited version like

  events {
    debug_connection 127.0.0.12;
  }

means that it will probably only log for the one specific request you
make using curl. Make one request, see the log, pick out the bits that
say which location{} was chosen.

Or adding something like

  return 200 "Location No. 9\n";

to each location{} block may be a short-term thing to confirm that you
configured nginx the way you wanted to configure nginx.

        f
--
Francis Daly        [hidden email]
_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx