How can I whitelist a user-agent in nginx?
- by djb
I'm trying to figure out how to whitelist a user agent from my nginx conf. All other agents should be shown a password.
In my naivity, I tried to put the following in before deny all:
if ($http_user_agent ~* SpecialAgent ) { allow; }
but I'm told "allow" directive is not allowed here (!).
How can I make it work?
A chunk of my config file:
…