我有一个服务器块,它监听特定服务器名称上的80个端口请求以及一些位置指令.我如何让nginx处理任何不匹配的请求,好像它没有收到它,那就让它超时?目前,这些请求被处理404错误
最佳答案
有一种方法可以忽略每个请求并告诉nginx什么都不回应:
server {
listen 80 default_server;
return 444;
}
记录在这里:http://nginx.org/en/docs/http/ngx_http_rewrite_module.html
The non-standard code 444 closes a connection without sending a response header.