Welcome! Log In Create A New Profile

Advanced

nginx hotlink with exception of mobile devices

Posted by portmap 
nginx hotlink with exception of mobile devices
December 02, 2013 06:25PM
Hi,
I currently have a hotlink protection like this:
location ~* .(bin|zip|mp4|mp3|jpg|png)$ {
valid_referers blocked mysite.com www.mysite.com;
if ($invalid_referer) {
return 405;
}

This works fine but it's blocking access from android and iphone devices, there is an app that should be allowed to access this, how can I add an exception so that it allows access from mobile devices, in the logs I see the following:

HTTP/1.1" 405 166 "-" "AppleCoreMedia/1.0.0.11B554a (iPhone; U; CPU OS 7_0_4 like Mac OS X; es_es)"

HTTP/1.1" 405 166 "-" "Player/LG Player 1.0 for Android(stagefright alternative)"

HTTP/1.1" 405 166 "-" "NexPlayer 4.0 for Android( stagefright alternative )"

Instead of referrer links it shows this, how can I add a rule that will allow any android or iphone device to access what the rule above is blocking?

Thanks,
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 338
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready