官方文档中提供的方法:
If you do not want to process requests with undefined "Host" header lines, you may define a default server that just drops the requests:
复制代码 代码如下:
server {
listen 80 default_server;
server_name _;
return 444;
}
复制代码 代码如下:
server {
listen 80 default_server;
server_name _;
rewrite ^ $request_uri?;
}
复制代码 代码如下:
server {
listen 80 default_server;
server_name _;
location /xxxxx{
stub_status on;
access_log off;
}
location /{
rewrite ^ $request_uri?;
}
}
新闻热点
疑难解答
图片精选