Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I get this error every few minutes when using mod_proxy as a reverse proxy to a SOAP web service. There's probably 3 or 4 requests going per seconds so we're talking around 1 or 2 out of every thousand that have this error.

[Tue Nov 23 11:44:14 2010] [error] [client 172.16.1.31] (20014)Internal error: proxy: error reading status line from remote server soap1.server:8888
[Tue Nov 23 11:44:14 2010] [error] [client 172.16.1.31] proxy: Error reading from remote server returned by /someapp/path/to/web/service

This causes the request to fail. If I have the client connect directly to the soap server without using the proxy, success is 100% so the problem appears to be in the proxy

The configuration looks like this. The purpose is to switch to a backup server if the primary one is unavailable:

<Proxy balancer://apicluster>  
BalancerMember http://soap1.server:8888 lbset=0 
BalancerMember http://soap2.server:8888 lbset=1 
</Proxy>  

ProxyPass /someapp balancer://apicluster/someapp 
ProxyPassReverse / balancer://apicluster/someapp 

Has anyone run into this and found a fix? There's some mentions in bug reports but no solutions. The only thing that may be unusual is the client request could be 100MB or larger, so the request could take a little longer than you'd expect for a SOAP call.

share|improve this question

2 Answers 2

up vote 7 down vote accepted

In case someone else runs into this. This is a bug in mod_proxy that can be avoided by putting these lines in your httpd.conf:

SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1

https://issues.apache.org/bugzilla/show_bug.cgi?id=37770

share|improve this answer
1  
thanks for adding the solution too! –  lakshmipathi Sep 11 at 4:03

Take note of the Apache documentation here: http://httpd.apache.org/docs/2.2/mod/mod_proxy_http.html

It seems there is a race condition in mod_proxy_http, but it can be avoided by including:

SetEnv proxy-initial-not-pooled 1

Which prevents Apache using a pooled connection if this is an initial request.

The document does note that this setting will give a performance downgrade.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.