Anyone have any idea for how to set up referer rules for only allowing certain referers download?
Here's my current setting:
[CODE]location /ttt/ {
valid_referers blocked hl2://1.2.3.4 ;
if ($invalid_referer) {
return 403;
}
}[/CODE]
It works for blocking browsers, but I noticed my other server with a different IP doesn't get blocked when I forgot to configure it.
The logs shows referers as:
referrer: "hl2://1.2.3.4:27015"
Well, I have figured this out.
Instead of putting that, you should give your solution so that other people searching can fix there problem. Letting people know you solved it doesn't really help anybody.
Didn't think anybody cared, here:
[CODE]location /ttt/ {
set $allowthis 0;
if ($http_user_agent != "Half-Life 2") {
return 444;
}
if ($http_referer = "hl2://1.2.3.4:27015") {
set $allowthis 1;
}
if ($http_referer = "hl2://1.2.3.4:27016") {
set $allowthis 1;
}
if ($http_referer = "hl2://1.2.3.4:27017") {
set $allowthis 1;
}
if ($http_referer = "hl2://5.6.7.8:27015") {
set $allowthis 1;
}
if ($http_referer = "hl2://5.6.7.8:27025") {
set $allowthis 1;
}
if ($http_referer = "hl2://5.6.7.8:27035") {
set $allowthis 1;
}
if ($allowthis = 0) {
return 444;
}
}[/CODE]
you can return 403 or 444, 444 just closes the connection without responding at all.
Sorry, you need to Log In to post a reply to this thread.