Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache reverse proxy "Failed to load resource" 502 Proxy Error

Background

As the path of least resistance on getting my Web app (served by AllegroServe) to deal with a potential partner's Shibboleth SOS setup I decided to try running Apache in front of AllegroServe, since the partner and Shibboleth support Apache.

Anyway, I took a dead simple approach and just dropped this in httpd.conf after turning on all the recommended modules for reverse proxy:

ProxyPass / http://localhost:8000 retry=1 acquire=3000 timeout=3000 Keepalive=On
ProxyPassReverse / http://localhost:8000

All the options on ProxyPass were added based on something I googled up, but timeout seems not to be the problem because this error comes back in a few milliseconds: "failed to load resource: the server responded with a status of 502 (Proxy Error)" on this bit of HTML in (the only thing that does load) the index.html:

<script type="text/javascript" src="script/soa.js"></script>

I also tried just loading an image and get the same error, and I put the image in the same directory as index.html in case it was a directory access issue.

I note, FWIW, that the request for soa.js or the image does not make it to AllegroServe (or at least it does not log anything).

btw, AllegroServe is running on port 8000 and I can access localhost:8000 without a problem. And to repeat myself, hitting localhost:8080 works as far as loading the index.html.

I have checked permissions on the directories in question but suspect that is not the issue since it is getting to the index.html (and, again, the follow-up request for the JS (or png file) do not seem even to be reaching AllegroServe.

like image 872
kennytilton Avatar asked Jul 16 '14 17:07

kennytilton


1 Answers

Need a slash (see after the 8000) to indicate the path is a wildcard so the whole tree is in play:

ProxyPass / http://localhost:8000/ retry=1 acquire=3000 timeout=3000 Keepalive=On 
ProxyPassReverse / http://localhost:8000/

-kt

like image 53
kennytilton Avatar answered Nov 17 '22 17:11

kennytilton