17 lines
358 B
Plaintext
Raw Normal View History

# Nginx WAF rules for RFI
location / {
set $attack_detected 0;
2025-01-10 00:27:14 +00:00
if ($request_uri ~* "!@endsWith .%{request_headers.host}") {
set $attack_detected 1;
}
2025-01-10 00:27:14 +00:00
if ($request_uri ~* "^(?i:file|ftps?|https?)://(?:d{1,3}.d{1,3}.d{1,3}.d{1,3})") {
set $attack_detected 1;
}
if ($attack_detected = 1) {
return 403;
}
}