[Nginx] Access restriction configuration to block specific IP addresses
I configured access restrictions in Nginx to block specific IP addresses, so I’ll introduce how to write the conf file.
The service went down due to attacks from specific IP addresses.
By the way, when I checked with the whois command, it was a Chinese IP address.
Just add deny IP address; inside the directive you want to refuse.
location / {
deny xxx.xxx.xxx.xxx;
}
That’s all from the Gemba where I wanted to refuse access only from specific IP addresses.