本文介绍了HTTP 444(无响应)而不是404、403错误页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我总是在nginx配置中使用"return 444"来阻止搜寻器直接通过IP或通过错误的主机名访问我的服务器.它只是关闭连接.完美.
I always use "return 444" in the nginx config to stop crawlers that access my servers directly via IP or via the wrong hostname. It just closes the connection. Perfect.
现在,我想使用此响应,而不是nginx抛出的标准404.html页面,但我无法进行配置.
Now i want to use this response instead of the standard 404.html pages that nginx throws but i fail at configuring.
error_page 500 502 503 504 /custom_50x.html;这很好,但是我不能像下面这样返回444":
This works fine, but i cant "return 444" like here:
server { listen 80; server_name ""; return 444; }有人知道将两者结合的方法吗?
Does anybody know a way to combine these two?
提前谢谢!
推荐答案重定向请求即可轻松返回状态代码
Redirect request then you can return status code easily
server { error_page 500 502 503 504 =444 @blackhole; location @blackhole { return 444; } }更多推荐
HTTP 444(无响应)而不是404、403错误页面?
发布评论