我基本上有两个问题:
如何将 RequestReadTimeout(在 mod_reqtimeout 中)、标题和正文时间设置为:无限制时间
和
如何将其应用于特定文件夹?
默认的 reqtimeout.conf 是:
<IfModule reqtimeout_module>
RequestReadTimeout header=10-20,minrate=500
RequestReadTimeout body=10,minrate=500
</IfModule>
所以它会是这样的:
<IfModule reqtimeout_module>
#Apply this to the /var/www/unlimitedtime folder
<Directory /var/www/unlimitedtime>
RequestReadTimeout header=unlimited,MinRate=0 body=unlimited,MinRate=0
</Directory>
</IfModule>
这不起作用,但这只是一个例子,可能会使我的问题更清楚。
谢谢
最佳答案
来自 official documentation of top
RequestReadTimeout 的几个提示:
Context: server config, virtual host
这意味着这个指令是一个相当高级的指令,你没有
Location
或 Directory
上下文在这里。事实上,在 Web 服务器可以对请求应用目录决策之前应用超时(未收到请求......),所以这是很正常的。意思是你不能在目录中应用此指令 ,对此您无能为力,抱歉。type=timeout
The time in seconds allowed for reading all of the request headers or body, respectively. A value of 0 means no limit.
所以不要使用
10-20
表单简单设置0
它变成了无限超时。或者至少这就是文档似乎暗示的内容。但这是使您的网络服务器启用 DOS 的一种非常好的方式。在正确的 url 上发送一些 HTTP 请求,您将得到一个不错的 拒绝服务 ,所以我希望其他一些超时设置会覆盖它(但也许不会,小心):-)
关于apache - 将 mod_reqtimeout 设置为特定文件夹的无限时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9162665/