简体   繁体   中英

mod_rewrite proxy timeout

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,

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM