Alex Mashin Wrote:
-------------------------------------------------------
> I use nginx as a reverse proxy. I need to specify a special
> location(s) for certain URLs containing Cyrillic letters that would
> prevent caching and cache lookup, which happen otherwise (for location
> /).
>
> 1) Are URLs really decoded as written at
> http://wiki.nginx.org/HttpCoreModule#location, so that I need to type
> Cyrillic characters in the location directive unencoded?
> 2) If so, what encoding should the configuration file be in?
> 3) Is there a way to force a regular expression location to be matched
> before the location /? Or impose my own order on locations matching?
> 4) What is the scope of a variable set within a location?
I can't really speak as to the text encoding (I've never used anything other than UTF8, which nginx works fine with), but as to the location, you shouldn't need need to force anything.
If it has a location that directly matches the URI it's given, it will automatically know to use it. It shouldn't matter if you spell it out (e.g. "location /forum/"), or try to use a regular expression (e.g. "location ~ ^/~(.+?)(/.*)?$" for the user directory, like apache does).
As for the variables, any variable placed within the location block will be specific to that location. If it's within the server block (but NOT in a location block), it will be global to all locations within that server block (but not accessible to other server blocks). Anything listed within the http block (but not any server blocks) will be global to all server blocks, and by extension all location blocks.
--
Piki