Nginx配置只允许指定ip访问
只在nginx配置文件location段加入代码后重启nginx,如下location / {client_max_body_size 48m;index index.html index.htm index.php;if (!-e $request_filename) {rewrite^(.*)$/index.php?s=$1last;
·
只在nginx配置文件location段加入代码后重启nginx,如下
location / {
client_max_body_size 48m;
index index.html index.htm index.php;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
allow 1234;
allow 4567;
deny all;
}
allow :允许访问的ip
deny:禁止除allow之外的ip访问
更多推荐
已为社区贡献1条内容
所有评论(0)