web-dev-qa-db-ja.com

Apache Server mod_proxyディレクティブのすべてのProxyPassマッピングのタイムアウトの設定

私が持っているものと動作するもの:

プロキシリクエストに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/

...

これはうまく機能します。

私が欲しいもの:

一部のリクエストに時間がかかっているため、タイムアウトしてProxy Error-Reason:Error reading from remote server

すべてのリクエストにtimeoutを設定します。 ProxyPassマッピングごとにtimeout=... KeepAlive=Onを追加せずにこれを実行できますか?

私は現在、次のようなものを持っています:

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

すべてのマッピングにtimeoutおよびKeepAliveパラメータを追加するように何らかの方法でApacheに指示できますか?前もって感謝します。

12
Raul Rene

私は自分で解決策を見つけることができました。 mod_proxyProxyTimeoutディレクティブを直接使用して、タイムアウトを設定できます。

ProxyRequests On 
<Proxy *>
    AddDefaultCharset off
    Order deny,allow
    Allow from all
</Proxy>
ProxyPreserveHost Off

ProxyTimeout 1200
28
Raul Rene