502 Proxy Error – Apache reverse proxy
Posted on 08 June 2010
I configured an Apache2 reverse proxy as described here. I could get the index page of the site to load but the css wasn’t getting applied. If I clicked any links on the site I get a 502 proxy error.
Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /page2.html.Reason: DNS lookup failure for: internal.domain3.compage2.html
I noticed that URL in the Reason line was missing the / between the domain and page2.html, but since it was present in the GET /page2.html I dismissed that clue. I launched into troubleshooting mode and checked DNS resolution, mod_proxy config, caching, etc.
Finally I took a shot in the dark and went back to the original error. I added a terminal / (shown in red below) to the mod_proxy statements in my httpd.conf file and if flipping worked. I didn’t see this required in any of the documents I read on configuring mod_proxy but who know’s. Maybe I’m a dumbass.
ProxyPass / http://internal.domain3.com/
ProxyPassReverse / http://internal.domain3.com/
ProxyHTMLURLMap http://internal.domain3.com/ /
Responses are closed for this post.