Best practices for solving location issues

Francis Daly francis at daoine.org
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 (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        francis at daoine.org


More information about the nginx mailing list