Best practices for solving location issues

Francis Daly francis at
Mon Oct 8 22:19:46 UTC 2018

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 ( holds lots
of information.

For testing, a limited version like

  events {

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.

Francis Daly        francis at

More information about the nginx mailing list