关闭。这个问题是off-topic .它目前不接受答案。
想改善这个问题吗? Update the question所以它是 on-topic对于堆栈溢出。
8年前关闭。
Improve this question
我拥有和工作的东西:
我将 Apache HTTPD 2.2 用于代理请求。我有多个 ProxyPass 映射:
ProxyRequests On
<Proxy *>
AddDefaultCharset off
Order deny,allow
Allow from all
</Proxy>
ProxyPreserveHost Off
ProxyPass /a http://some_ip/
ProxyPassReverse /a http://some_ip/
ProxyPass /b http://some_other_ip/
ProxyPassReverse /b http://some_other_ip/
...
这很好用。
我要的是:
我的一些请求需要更长的时间,所以他们超时给我一个 代理错误 - 原因:从远程服务器读取错误 .
我要设置
timeout
对于我所有的要求。我可以这样做而不必添加 timeout=... KeepAlive=On
每 ProxyPass
映射?我目前有类似的东西:
ProxyPass /a http://some_ip/ timeout=1200 KeepAlive=On
ProxyPassReverse /a http://some_ip/
ProxyPass /b http://some_other_ip/ timeout=1200 KeepAlive=On
ProxyPassReverse /b http://some_other_ip/
... and i do this for all my ProxyPass mappings
我可以以某种方式告诉 Apache 添加
timeout
和 KeepAlive
所有映射的参数?提前致谢。
最佳答案
我已经设法自己找到了解决方案。您可以直接使用 ProxyTimeout
设置超时。 mod_proxy
的指令:
ProxyRequests On
<Proxy *>
AddDefaultCharset off
Order deny,allow
Allow from all
</Proxy>
ProxyPreserveHost Off
ProxyTimeout 1200
关于apache - 在 Apache Server mod_proxy 指令中为所有 ProxyPass 映射设置超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14829025/