Last active
March 19, 2024 15:43
-
-
Save AlekseyArh/c815f70cfe0036928ebe5074b3bf9f4a to your computer and use it in GitHub Desktop.
Блокировка запросов в nginx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Блокировка запросов в nginx по user agent (включая пустой user_agent - ^$) | |
if ( $http_user_agent ~* (^$|wget|curl) ) { | |
return 418 " "; | |
} | |
# Блокировка по части ссылки | |
location ~ (wp-|\.php$|\.jsp$|\.asp$|\.perl$|\.env$|\.git) { | |
return 418 " "; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment