How to edit url and pass forward to wsgi?

Francis Daly francis at daoine.org
Thu Sep 3 18:47:19 UTC 2015


On Thu, Sep 03, 2015 at 08:40:36AM -0400, Thomas Nyberg wrote:

Hi there,

> On a related note, is there some way to log the location choices
> that are made? I tried using a debug logging mode, but it was far
> too low-level (on the level of memory allocations). Of course I
> could have the routes' outputs go to certain files to figure it out,
> but if there was a way to log something like "taking route
> `/staging/doc/.*/info/cat`" it would make things much easier.

The debug log should have a bunch of "test location:" lines, followed
by one "using configuration" line. That's the location that is being
used for this request.

Other than that, the rules at http://nginx.org/r/location and at
http://nginx.org/en/docs/http/request_processing.html should make it
straightforward to determine which location is used for this request.

And now that you know that regexes are not implicitly anchored, it should
be clear what is going on.

It's even easier if there are only prefix locations in use.

Cheers,

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list