There's something hitting a server I'm looking at a rapid rate and it's taking the site down. It's doing ...
POST /index.php/api/v2_soap/ HTTP/1.1, host: dev.mysite.com
I'd like to block all IPs to dev.mysite.com
except for my IP.
I have the Nginx config file here: /etc/nginx/nginx.conf
. [1]
I have the site-specific file here: /etc/nginx/sites-enabled/dev-mysite
. [2]
I've tried the below in [2].
location / {
... # some other stuff
allow 172.xx.xx.xx; # my IP
deny all;
}
and it's blocking all traffic to dev.mysite.com
except mine, but the POST request is still coming through, unless I configure the below in [1].
http {
...
deny 216.xxx.xxx.xxx; # offending IP
...
}
Is there a way to modify just file [2] and achieve what I'm trying to do (deny all traffic except from my IP)?