new to this site, so I will keep him posted:
I have:
if ($http_user_agent ~* (A-certain-self-made-User-Agent-here)) { return 200; }
Which works very well. (Tested by switching 200 to 403).
My question is : is there a way: / etc / nginx / sites-enabled / default so that it only allows ONE User-Agent and forbids the rest
I know this seems silly, but this is what I would like to do (if possible). How maybe this ?:
if (http_user_agent ~*(user-agent)) { return 200; else return 403; }
source share