打开 Nginx 的 conf 文件夹下的 default.conf 文件,在 server 中添加如下内容:
server{
listen 端口号;
server_name 域名或者IP地址;
if($http_Host !~* '域名或IP地址'){
return 403;
}
}
然后保存
打开 Nginx 的 conf 文件夹下的 default.conf 文件,在 server 中添加如下内容:
server{
listen 端口号;
server_name 域名或者IP地址;
if($http_Host !~* '域名或IP地址'){
return 403;
}
}
然后保存