In Nginx configuration sometimes we need to restrict a user or a network segment to access the specified content, so you need to configure the Nginx configuration file, set the method as follows:
Website: www.a.com A site we set limits 192.168.26.70 this IP access:
Website: www.b.com
Edit Profile: vim/etc/nginx/nginx.conf
Nginx.conf:
server {
Listen 80;
server_name www.a.com;
root/data/www/a.com;
Index index.html index.htm;
Deny 192.168.26.70; #限制IP或IP段访问此网站
}
server {
Listen 80;
server_name www.b.com;
root/data/www/b.com;
Index index.html index.htm;
}
}
Access-Control access module:
Allow
Deny
Top-down authentication, by default
Access the www.a.com,www.b.com observation results on two client computers, respectively.
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/8C/63/wKioL1hrQxDCfkBNAAE-zP7gDS4009.png-wh_500x0-wm_3 -wmp_4-s_781989117.png "title=" Clipboard.png "alt=" Wkiol1hrqxdcfkbnaae-zp7gds4009.png-wh_50 "/>
This article comes from "on the road ... Find the Lost Memory "blog, be sure to keep this source http://jdonghong.blog.51cto.com/3473478/1888551
Setting limits in Nginx specify user or IP group access rights