I'm trying to whitelist a very specific User Agent string in Nginx. The below examples demonstrate how to whitelist general types of browsers (eg mozilla or chrome), but the string I want to whitelist has /
and (
which breaks the nginx conf.
How to whitelist a user agent for nginx?
https ://gist.github.com/supairish/2951524
https ://www.scalescale.com/tips/nginx/block-user-agents-nginx/
https ://www.cyberciti.biz/faq/nginx-if-conditional-http_user_agent-requests/
https ://stackoverflow.com/questions/17674293/allow-only-one-user-agent-block-the-rest-in-nginx
Is it possible to whitelist the below string?
if ($http_user_agent ~* (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36) ) {
return 403;
}