G
G
Georg2016-01-01 18:28:32
Nginx
Georg, 2016-01-01 18:28:32

How to block post requests for url in nginx by mask?

Good afternoon. They bomb the site with simple ddos ​​at different URLs like /cat/podcat/1562740
cat and podcat do not change, only the number changes
What should I write in the NGINX config to block only POST requests to these URLs?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Moiseykin, 2016-01-01
@Georg

Like so

location ~ /cat/podcat/\d+$ {
  if ($request_method = "POST") {
    deny  all;
  }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question