dylan
asked Sep 19 2017
Answer
"create blockips.conf in /usr/local/nginx/conf/, enter
#vi blockips.conf
Append / add entries as follows:
deny 1.2.3.4;
deny 91.212.45.0/24;
deny 91.212.65.0/24;
Save and close the file. Test the config file, enter:
#/usr/local/nginx/sbin/nginx -t
Finally,
Reload the new config, enter
#/usr/local/nginx/sbin/nginx -s reload
If allow ....
location / {
#block one workstation
deny 192.168.1.1;
#allow anyone in 192.168.1.0/24
allow 192.168.1.0/24;
#drop rest of the world
deny all;"
linuxhelp
asked Jan 14 2019
edited Jan 14 2019
Related tutorials in How to allow trusted IP only and deny all other IP in nginx
Related forums in How to allow trusted IP only and deny all other IP in nginx
A common misconfiguration is that the 'session.save_path' directive is not pointing to a valid directory.
Jun 15 2019
How to allow trusted IP only and deny all other IP in nginx
I' m new for nginx. i don' t know how to deny all unwanted ip' s in nginx, if any body knows solution please post here...!!!