控制台IP访问限制

在控制台vi /usr/local/nginx/conf/nginx.conf +127

添加

location /index/main/main
{

if ( $remote_addr !~ “(96.0.23.198|96.0.22.49)”) { return 403;}
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
}

}

保存退出,重启nginx服务:systemctl restart nginx生效,只有96.0.23.198和96.0.22.49这两个IP能正常打开控制台界面,其它IP输入密码登录后会显示403