nginx disallows the way an IP site is set up
- 2020-05-06 12:13:19
- OfStack
First create the following configuration file and place it in nginx's conf directory, blocksip.conf:
deny 95.105.25.181;
Save it.
Add: include blocksip.conf;
Reset the nginx services: / usr/local/nginx/sbin/nginx - s reload can take effect.
There are many formats for blocksip.conf: and you can configure only permitted IP access or IP segment access:
deny IP;
allow IP;
# block all ips
deny all;
# allow all ips
allow all;
Where the net section is written like this: 192.168.1.0/24 such form.
That will do the trick.
deny 95.105.25.181;
Save it.
Add: include blocksip.conf;
Reset the nginx services: / usr/local/nginx/sbin/nginx - s reload can take effect.
There are many formats for blocksip.conf: and you can configure only permitted IP access or IP segment access:
deny IP;
allow IP;
# block all ips
deny all;
# allow all ips
allow all;
Where the net section is written like this: 192.168.1.0/24 such form.
That will do the trick.