how to check for headers

Francis Daly francis at
Fri Aug 17 13:46:45 UTC 2012

On Fri, Aug 17, 2012 at 06:23:04AM -0400, amonmitch wrote:

Hi there,

> How would you check for sth like HTTP:Accept-Language? and in general all
> headers? if it is equal to some value, empty or etc. Apache would allow this
> to be checked in a notation similar to the following inside a mod_rewrite
> config:
> %{HTTP:Accept-Language} 
> Is there a similar variable to be used in nginx config?

variables are at

"map" is at

"if" is at

Be aware of when you shouldn't use "if" inside "location", such as is
written at

Depending on what exactly you want to do, frequently "map" can be used
instead of "if".

Francis Daly        francis at

More information about the nginx mailing list