Varnish hotlink protection with multiple referers
up vote
0
down vote
favorite
I have been trying to follow this: https://varnish-cache.org/trac/wiki/VCLExampleAvoidHotlinking
And include multiple referers such as:
if (req.http.host == "example.com" &&
req.url ~ "^/wp-content/uploads/" &&
(req.http.referer && req.http.referer !~ "^http://example.com/" && req.http.referer !~ "^http://twitter.com/" && req.http.referer !~ "^http://linkedin.com/" && req.http.referer !~ "^http://lnkd.in/" && req.http.referer !~ "^http://t.co/" && req.http.referer !~ "^http://google.com/" && req.http.referer !~ "^http://bing.com/" && req.http.referer !~ "^http://yahoo.com/")) {
return (synth(403, "No hotlinking please"));
}
But it does not want to execute and seems the referer is stripped. Any help would be amazing. Thanks!
varnish varnish-vcl hotlinking
add a comment |
up vote
0
down vote
favorite
I have been trying to follow this: https://varnish-cache.org/trac/wiki/VCLExampleAvoidHotlinking
And include multiple referers such as:
if (req.http.host == "example.com" &&
req.url ~ "^/wp-content/uploads/" &&
(req.http.referer && req.http.referer !~ "^http://example.com/" && req.http.referer !~ "^http://twitter.com/" && req.http.referer !~ "^http://linkedin.com/" && req.http.referer !~ "^http://lnkd.in/" && req.http.referer !~ "^http://t.co/" && req.http.referer !~ "^http://google.com/" && req.http.referer !~ "^http://bing.com/" && req.http.referer !~ "^http://yahoo.com/")) {
return (synth(403, "No hotlinking please"));
}
But it does not want to execute and seems the referer is stripped. Any help would be amazing. Thanks!
varnish varnish-vcl hotlinking
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have been trying to follow this: https://varnish-cache.org/trac/wiki/VCLExampleAvoidHotlinking
And include multiple referers such as:
if (req.http.host == "example.com" &&
req.url ~ "^/wp-content/uploads/" &&
(req.http.referer && req.http.referer !~ "^http://example.com/" && req.http.referer !~ "^http://twitter.com/" && req.http.referer !~ "^http://linkedin.com/" && req.http.referer !~ "^http://lnkd.in/" && req.http.referer !~ "^http://t.co/" && req.http.referer !~ "^http://google.com/" && req.http.referer !~ "^http://bing.com/" && req.http.referer !~ "^http://yahoo.com/")) {
return (synth(403, "No hotlinking please"));
}
But it does not want to execute and seems the referer is stripped. Any help would be amazing. Thanks!
varnish varnish-vcl hotlinking
I have been trying to follow this: https://varnish-cache.org/trac/wiki/VCLExampleAvoidHotlinking
And include multiple referers such as:
if (req.http.host == "example.com" &&
req.url ~ "^/wp-content/uploads/" &&
(req.http.referer && req.http.referer !~ "^http://example.com/" && req.http.referer !~ "^http://twitter.com/" && req.http.referer !~ "^http://linkedin.com/" && req.http.referer !~ "^http://lnkd.in/" && req.http.referer !~ "^http://t.co/" && req.http.referer !~ "^http://google.com/" && req.http.referer !~ "^http://bing.com/" && req.http.referer !~ "^http://yahoo.com/")) {
return (synth(403, "No hotlinking please"));
}
But it does not want to execute and seems the referer is stripped. Any help would be amazing. Thanks!
varnish varnish-vcl hotlinking
varnish varnish-vcl hotlinking
asked Nov 11 at 1:00
user10634742
11
11
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53244919%2fvarnish-hotlink-protection-with-multiple-referers%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown