block bad referrers
This commit is contained in:
5
confs/global/map-referrer.conf
Normal file
5
confs/global/map-referrer.conf
Normal file
@@ -0,0 +1,5 @@
|
||||
map $http_referer $bad_referrer {
|
||||
hostnames;
|
||||
default no;
|
||||
%BLOCK_REFERRER%
|
||||
}
|
||||
@@ -90,6 +90,9 @@ http {
|
||||
# list of blocked user agents
|
||||
%BLOCK_USER_AGENT%
|
||||
|
||||
# list of blocked referrers
|
||||
%BLOCK_REFERRER%
|
||||
|
||||
# zone for proxy_cache
|
||||
%PROXY_CACHE_PATH%
|
||||
|
||||
|
||||
3
confs/site/block-referrer.conf
Normal file
3
confs/site/block-referrer.conf
Normal file
@@ -0,0 +1,3 @@
|
||||
if ($bad_referrer = yes) {
|
||||
return 444;
|
||||
}
|
||||
@@ -25,6 +25,7 @@ server {
|
||||
%FEATURE_POLICY%
|
||||
%PERMISSIONS_POLICY%
|
||||
%BLOCK_USER_AGENT%
|
||||
%BLOCK_REFERRER%
|
||||
%BLOCK_TOR_EXIT_NODE%
|
||||
%BLOCK_PROXIES%
|
||||
%BLOCK_ABUSERS%
|
||||
|
||||
Reference in New Issue
Block a user