【发布时间】:2017-09-04 15:58:14
【问题描述】:
我想知道是否可以通过 IP 限制某些资源: 我想允许每个人都使用根模式,并且我想将所有根限制为某个 IP 和子网。
在我的 nginx conf 中,我放了这个:
#1 allow pdf files access to all
location ~* /\.pdf$ {
allow all;
}
#2 restrict to these networks
allow <ip1>;
allow <network1>/22;
allow <network2>/23;
#3 deny all other network
deny all;
当我尝试从与块 #2 不同的 ips 进行连接时,我收到拒绝访问。 如何从块 #2 的不同 IP 访问 pdf 文件?
【问题讨论】:
标签: nginx configuration