Answer the question
In order to leave comments, you need to log in
Disable hotlinking for a specific list of sites in nginx?
The standard scheme for banning hotlinking is known - (forbidden for everyone except search engines and social networks). I also need to configure the config to prohibit only a specific list from several domains. Those. everyone, except for a few specified domains, is allowed to hotlink. Please share the code
Answer the question
In order to leave comments, you need to log in
if ($http_referer ~* "^https?://(site1\.ru|site2\.com|site3\.org)") {
return 403;
}
valid_referers ~^(?!site1\.ru|site2\.com|site3\.org);
if ($invalid_referer) {
return 403;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question