Nested location blocks?

Grzegorz Nosek grzegorz.nosek at
Wed May 21 12:48:42 MSD 2008

On Tue, May 20, 2008 at 08:22:29PM -0700, Rt Ibmer wrote:
> A few days ago someone mentioned here that nested location directives/blocks are supported, but are undocumented because there are some issues with it or it doesn't work as expected in all cases, or something like that. 
> Anyway I was hoping to get more information as to what exactly the concern/issues are so I can decide if that's something that would still work for me. Can someone please elaborate? Thanks!

I have cooked up a patchset to support nested locations some time ago.
Feel free to use it with some caveats:
 - nginx 0.5.35 only
 - it has known bugs which I can't be bothered to fix at the moment
   (e.g. nesting regex locations fails spectacularly) -- I just work
   around them
 - it's pretty intrusive as it introduces the notion of creating/merging
   configuration sections at runtime (vanilla nginx only does it while
   parsing the config file)
 - when I migrate to 0.6, I'll probably remodel my config files and drop
   the patchset altogether.

If you're not discouraged yet, :) have a look at my nginx repo at

Best regards,
 Grzegorz Nosek

More information about the nginx mailing list