apache - 在 Apache Server mod_proxy 指令中为所有 ProxyPass 映射设置超时

标签 apache apache2 mod-proxy apache2.2

关闭。这个问题是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=OnProxyPass映射?

我目前有类似的东西:
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 添加 timeoutKeepAlive所有映射的参数?提前致谢。

最佳答案

我已经设法自己找到了解决方案。您可以直接使用 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/

相关文章:

django - 使用 mod_python 设置 Django,使用 Alias 在 SuSE 上设置 Apache

.htaccess - 跨域访问不起作用

python - Django Response 总是 Chunked with text/html 无法设置 Content-Length

apache - 转发 HTTPS 代理 Apache 不工作并且没有日志

php - 从不同的网络获取网络数据

apache - 如何在 Apache 中正确配置 VirtualHost(用于 eXist-db 应用程序)

php - 命令docker-compose(re)build不构建容器的新实例

Apache 'if' 指令中的正则表达式...这里出了什么问题?

server - 运行多个服务器

node.js - 如何使用示例在端口 80 上运行 sails.js 应用程序?