File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,31 @@ server {
89
89
return 444;
90
90
}
91
91
92
+
93
+ # ===========================================
94
+ # Block certain patterns when no referer set:
95
+ # ===========================================
96
+
97
+ # Create a variable to track if referer is empty
98
+ set $suspect_arg 0;
99
+
100
+ # If any of the following parameters are set...
101
+ if ($args ~* "(v=|m=|action=)") {
102
+ set $suspect_arg 1;
103
+ }
104
+
105
+ # AND if the referer is set...
106
+ if ($http_referer = "" ) {
107
+ set $suspect_arg "${suspect_arg}1";
108
+ }
109
+
110
+ # Block requests with m= v= or action= parameters and empty referer
111
+ if ($suspect_arg = "11") {
112
+ return 444;
113
+ }
114
+
115
+ # -------------------------------------------
116
+
92
117
proxy_pass http://webnodes;
93
118
proxy_set_header Host $http_host;
94
119
You can’t perform that action at this time.
0 commit comments