mod_rewrite代理超时 [英] mod_rewrite proxy timeout

查看:83
本文介绍了mod_rewrite代理超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已设置apache来代理对后端应用程序服务器的请求.有多个后端服务器,并且有一个很大的rewrite_rules文件,该文件针对每个请求进行处理,以将所有请求正确地代理到应用程序服务器.一台特定的应用服务器有时需要很长的时间进行响应,如果代理将很多请求代理到该特定服务器,则会导致代理服务器变慢,因为这些请求正等待获得响应并最终在指定的超时后超时用于Apache请求.我只想为这个特定的重写规则设置一个超时时间,该超时时间小于apache超时值,以便资源可以快速释放并避免在高峰流量时间内出现其他问题.我尝试使用

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

或放置ProxyTimeout的指令ProxyTimeout 30

or directive to put ProxyTimeout ProxyTimeout 30

但是这是不允许的.感谢专家在此问题上的任何帮助.

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

谢谢

推荐答案

我只是遇到了这个问题,并通过增加httpd.conf中的整体超时指令来解决此问题.因此,请更改:

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

设置为更合适的值.

能够为单个URL做到这一点将是非常棒的,但是由于此处缺少响应和

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.

这篇关于mod_rewrite代理超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆