nginx only allows access within the network ip, external network access is prohibited

#配置清单

location / {
   deny 192.168.1.1;
   allow 127.0.0.0/24;
   allow 192.168.0.0/16;
   allow 10.10.0.0/16;
   deny all;
   root /opt/hx_cmssearch2.5;
   index index.jsp;
   expires 60;
   keepalive_timeout 60;
}

Precautions:

1. deny sure to add a ip , or jump directly to 403 without executing the down; if 403 is the default page under the same domain name, will result in an infinite loop access;

2. allow the ip segment

 Ascending order to allow access from Dan as 127.0.0.0/ 24  below can be 10.10.0.0/ 16

 24 is the subnet mask: 255.255.255.0

 16 is the subnet mask: 255.255.0.0

 8 represents the subnet mask: 255.0.0.0

3. deny all; ending  said that apart from the above allow other prohibited

Guess you like

Origin www.cnblogs.com/xsnow/p/11011718.html
Recommended