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.

We are using apache proxy to enable our application servers to reach specific web sites over the internet. The setup is as follows:

application servers --> apache proxy --> Internet website 

Some of the requests fail with the below error in the application server log:

<head>
<title>502 Proxy Error</title>
</head><body>
<h1>Proxy Error</h1>
<p>The proxy server received an invalid
response from an upstream server.<br />
The proxy server could not handle the request <em><a href="/link">POST
nbsp;/link</a></em>.<p>
Reason: <strong>Error reading from remote server</strong></p></p>
</body>

and the below debug log in the apache error.log file:

[Mon May 20 09:57:54 2013] [debug] mod_proxy_http.c(56): proxy: HTTP: canonicalising URL //myURL.com
[Mon May 20 09:57:54 2013] [debug] proxy_util.c(1506): [client 172.20.101.71] proxy: https: found worker `https://myurl.com/` for `https://myurl.com/link`
[Mon May 20 09:57:54 2013] [debug] mod_proxy.c(1015): Running scheme https handler (attempt 0)
[Mon May 20 09:57:54 2013] [debug] mod_proxy_http.c(1973): proxy: HTTP: serving URL https://myurl.com/link
[Mon May 20 09:57:54 2013] [debug] proxy_util.c(2011): proxy: HTTPS: has acquired connection for (mu=y url)
[Mon May 20 09:57:54 2013] [debug] ssl_engine_io.c(1908): OpenSSL: I/O error, 5 bytes expected to read on BIO#136e90 [mem: 190593]
[Mon May 20 09:57:54 2013] [debug] proxy_util.c(2067): proxy: connecting https://myurl.com/link to myurl.com:443
[Mon May 20 09:57:54 2013] [debug] proxy_util.c(2193): proxy: connected /link to myurl.com:443
[Mon May 20 09:57:54 2013] [debug] ssl_engine_io.c(1908): OpenSSL: I/O error, 5 bytes expected to read on BIO#136e90 [mem: 190593]
[Mon May 20 09:57:54 2013] [info] [client ip] (131)Connection reset by peer: SSL input filter read failed.
[Mon May 20 09:57:54 2013] [error] [client ip2] (131)Connection reset by peer: proxy: error reading status line from remote server myurl.com:443
[Mon May 20 09:57:54 2013] [debug] mod_proxy_http.c(1466): [client ip2] proxy: NOT Closing connection to client although reading from backend server "myurl.com:443 failed.
[Mon May 20 09:57:54 2013] [error] [client ip2] proxy: Error reading from remote server returned by /link
[Mon May 20 09:57:54 2013] [debug] proxy_util.c(2029): proxy: HTTPS: has released connection for (myurl.com)

Any ideas how I can solve this issue, knowing that the majority of the requests are being successfully sent and the response is being received normally. All the requests are the same length and generated automatically so the problem couldn't be in the request itself.

share|improve this question
    
What's up with that question title? –  MDMarra May 20 '13 at 11:56
5  
@MDMarra: An astonishing number of people put their job title in the "title" field.... –  Sven May 20 '13 at 11:57
    
ಠ_ಠ Wow. I can't believe I've never seen that before. –  MDMarra May 20 '13 at 13:41
    
Are all of your failures in relation to HTTPS links? –  jeffatrackaid May 20 '13 at 13:44
    
@jeffatrackaid: yes all the failures are in relation to https, actually the proxy server is connecting to only one link through https. –  Hytham May 20 '13 at 18:11

1 Answer 1

Check if you have both SSLProxyVerify none and SSLProxyCheckPeerCN off on your SSL Proxy Virtual Host.

share|improve this answer
    
the SSLProxyVerify default value is none and the SSLProxyCheckPeerCN default value is off and I didn't change those default values.. do I have to set them manually in the configuration file? –  Hytham May 26 '13 at 8:56
    
Also does the caching has anything to do in this issue ?? –  Hytham May 26 '13 at 8:57
    
i have found an appropriate solution for this problem and I am sharing it so that anyone facing the same issue can make use of it: my problem was solved by setting the below parameters in the httpd.conf file in the proxy SetEnv force-proxy-request-1.0 1 and SetEnv proxy-nokeepalive 1, I got this solution from this blog: https://issues.apache.org/bugzilla/show_bug.cgi?id=37770 –  Hytham May 27 '13 at 10:53
    
After deploying this solution i faced another problem as the client was sending the request using HTTP/1.1 and the proxy was forced to use HTTP/1.0 as per the previous setEnv parameters, this caused HTTP error HTTP/1.1 417 Expectation Failed, as per my searching this error could be solved from the client side or from the proxy side, this URL explains how to solve it from client side http://stackoverflow.com/questions/566437/http-post-returns-the-error-417-expec‌​tation-failed-c which I did not test. –  Hytham May 27 '13 at 11:03
    
while this URL explains how you can solve this error from the proxy side https://lists.gnu.org/archive/html/sks-devel/2013-03/msg00017.html , I have implemented the proxy side solution and I am monitoring the results now. my added parameters in the httpd.conf file became: SetEnv force-proxy-request-1.0 1 SetEnv proxy-nokeepalive 1 RequestHeader unset Expect early –  Hytham May 27 '13 at 11:06

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.