Forum: NGINX 403 for multiple user agents

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Payam C. (Guest)
on 2009-04-06 01:31
(Received via mailing list)
Hi,

I recall there was a way to search for multiple strings within the
user agent to allow a 403 redirect... but i cant find any info on
this.

example. im 403`ing any user agents that match the Macintosh string.
now id like to be able to do this for say "Macintosh, Windows,
Firefox..." so on

if ($http_user_agent ~ Macintosh) {
    return 403;
}

thanks
Payam C. (Guest)
on 2009-04-06 02:01
(Received via mailing list)
wow, feel kinda dumb... :)
 i used "|" statement in between each string and it works like a charm

cheers
-payam
This topic is locked and can not be replied to.