【发布时间】:2017-05-16 05:21:14
【问题描述】:
我总是在 nginx 配置中使用“return 444”来阻止爬虫直接通过 IP 或通过错误的主机名访问我的服务器。它只是关闭连接。完美。
现在我想使用这个响应而不是 nginx 抛出的标准 404.html 页面,但我无法配置。
error_page 500 502 503 504 /custom_50x.html;
这很好用,但我不能像这里一样“返回 444”:
server {
listen 80;
server_name "";
return 444;
}
有人知道如何将这两者结合起来吗?
提前致谢!
【问题讨论】:
-
一个有趣的方法,考虑到slowloris和类似的滴水连接攻击的问题。
-
是的,但是slowloris已经对nginx没有影响了???
标签: http nginx http-status-code-404 httpresponse