## Add here all HTTP method allowed map $request_method $bad_method { default 1; ~(?i)(GET|HEAD|POST) 0; } ## Add here all user agents that are to be blocked. map $http_user_agent $bad_bot { default 0; ~(?i)(httrack|WinHTTrack|htmlparser|libwww|Python|perl|urllib|Zeus|scan|Curl|email|PycURL|Pyth|PyQ|WebCollector|WebCopier|WebCopy|webcraw|LWP: :simple|Havij) 1; } ## Add here all referrers that are to blocked. map $http_referer $bad_referer { default 0; ~(?i)(babes|click|forsale|jewelry|nudit|organic|poker|porn|amnesty|poweroversoftware|webcam|zippo|casino|replica) 1; }
## Request-range protection fix. if ($http_range ~ "(?:d*s*-s*d*s*,s*){5,}") { return 416; } ## Deny access based on HTTP method if ($bad_method = 1) { return 444; } ## Deny access based on the User-Agent header if ($bad_bot = 1) { return 403; } ## Deny access based on the Referer header if ($bad_referer = 1) { return 403; }
歡迎光臨 ADJ網路實驗室 (http://dz.adj.idv.tw/) | Powered by Discuz! 6.0.0 |