Answer the question
In order to leave comments, you need to log in
How to block header in nginx?
Good day!
There was such a need to block certain headers in nginx, namely when dumping, we can see
How to block all headers in NGINX that have a SQUID server?
I will be very grateful for your help
Answer the question
In order to leave comments, you need to log in
https://www.cyberciti.biz/faq/unix-linux-appleosx-...
### case sensitive http user agent blocking ###
if ($http_user_agent ~ (Catall Spider|AcoiRobot) ) {
return 403;
}
### case insensitive http user agent blocking ###
if ($http_user_agent ~* (foo|bar) ) {
return 403;
}
map $http_via $is_not_ok {
default "0";
"~*squid" "1";
}
if ($is_not_ok) {
return 405;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question