Welcome! Log In Create A New Profile

Advanced

Re: Hotlink protection before proxy when using proxy_pass?

Anonymous User
May 25, 2012 02:52PM
> or use nested locations (I think it should work):

That failed to work, still getting the same errors :-/


> So you either have to duplicate the proxy_* block:

I switched to

location ~* \.(png|gif|jpg|jpeg|swf|ico)(\?[0-9]+)?$ {
valid_referers none blocked dev.local.lan
*.dev.local.lan;
if ($invalid_referer) {
return 403;
}
proxy_pass http://PROXY;
proxy_redirect off;
...
}

location / {
proxy_pass http://PROXY;
proxy_redirect off;
...
}

and for valid referrer (e.g., visiting the site from
mach2.dev.local.lan), the site renders correctly, and I can 'grab' all
image files for hotlinking.

BUT, I'm still able to hotlink to (for example)

http://dev.local.lan/favicon.ico

from a !whitelisted machine, e.g. visiting from other.other.lan.

RandyK

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Hotlink protection before proxy when using proxy_pass?

Anonymous User May 25, 2012 12:08PM

Re: Hotlink protection before proxy when using proxy_pass?

Reinis Rozitis May 25, 2012 12:28PM

Re: Hotlink protection before proxy when using proxy_pass?

Anonymous User May 25, 2012 02:52PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 195
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