Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
This is more suitable
in the context of location (in the server it will probably work too)
if ($content_type ~* form-data) {
return 404; // Ну или редирект
}
You can forbid accepting POST requests at all, or limit their size:
# не принимать POST вообще
location /nopost/ {
limit_except GET HEAD { deny all; }
}
# не больше 1к данных постом
location /smallpost/ {
client_max_body_size = 1k;
}
And what is the difference between a regular POST request and a POST request with a file, in your opinion)? That's right, nothing. The file is inserted into request_body in binary form.
So just size. Or completely banned.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question