map a null/missing variable?
contact at jpluscplusm.com
Wed Mar 13 18:27:20 UTC 2013
On 13 March 2013 18:19, AJ Weber <aweber at comcast.net> wrote:
> So I'm still working on my caching "issue", but this is a more general
> question, so for the sake of indexing and helping others in the future with
> (hopefully) a response...
> How do I use a map to map the lack of a variable/header/cookie (NULL?) to a
> value? I can't use "default", because when there IS a value it will be a
> random set of characters.
> So that said, if a regex like ".+" would work for "any value" and I use
> 'default' for the NULL, I would try that. :)
Have you read the docs? http://nginx.org/r/map
Just make sure you have a recent enough version that support regex in
maps, and it /should/ be pretty obvious.
Jonathan Matthews // Oxford, London, UK
More information about the nginx