添加白名单配置
if ($clientRealIp ~ "192.157.34.245|17.213.126.21") {
rewrite ^.*$ /403.html last;
break;
}
添加站点配置信息
nginx.conf 文件最后一行添加
并新建vhost 目录
include /usr/local/nginx/conf/vhost/*.conf;
include vhost/*.conf;
if ($clientRealIp ~ "192.157.34.245|17.213.126.21") {
rewrite ^.*$ /403.html last;
break;
}
nginx.conf 文件最后一行添加
并新建vhost 目录
include /usr/local/nginx/conf/vhost/*.conf;
include vhost/*.conf;