Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

nginx hotlink with exception of mobile devices

$
0
0
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,

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>