mod_rewrite proxy timeout

混江龙づ霸主 提交于 2021-02-20 11:21:28

问题


I have apache setup to proxy requests to backend app servers. There are several backend servers and there is a big rewrite_rules file which is processed for each request to properly proxy all the requests to app servers. One particular app server sometimes takes a long time to respond back, causing the proxy server to become slow if a lot of requests are being proxied to that particular server, as the requests are waiting to get the response back and eventually timeout after the timeout specified for apache requessts. I would like to put a timeout for this particular rewrite rule only, which is less than the apache timeout value, so that the resources are quickly free and avoid other problems during peak traffic times. I tried using

or directive to put ProxyTimeout ProxyTimeout 30

however this is not allowed. Appreciate any help from experts on this issue.

Thanks,


回答1:


I just ran into this issue, and solved it by incrementing the overall timeout directive in httpd.conf. So, change:

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 60

to a more appropriate value.

It would be great do be able to do this for individual URLs, but it doesn't appear to be possible due to the lack of responses here and the Apache mailing list.



来源:https://stackoverflow.com/questions/13609852/mod-rewrite-proxy-timeout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!