0

Apache2, mod_proxy installed, using reverse proxy for more than a dozen sites, works flawlessly for those. Added one more directive but going to that URL results in a 404 error.

For the purpose of this question the apache server is designated as web1.

<Ifmodule proxy_module>
 ProxyRequests Off
 <Proxy *>
  Order deny,allow
  Allow from all
 </Proxy>

The directive below is an example of what works for all (but one) existing cases. It's noteworthy that all existing cases pass the request from /somedirectory (on web1) to http://somewebserver/somedirectory.

ProxyPass /sample1 http://web2/sample1
ProxyPassReverse /sample1 http://web2/sample1

The directive below results in a 404:

ProxyPass /sample3 http://web3
ProxyPassReverse /sample3 http://web3

The difference is that for /sample3 the directive points to the root of web3 rather than a directory on web3.

There's also the question whether the 404 is actually being generated by Apache on web1 or not. When setting LogLevel debug on web1 the error_log does not contain any errors about the ProxyPass ProxyPassReverse directives. Likewise the access_log on web1 does not contain any trace of the request to /sample3.

This is what the 404 looks like in Firefox/Chrome:

404

The goal is to have content located on in the root of web3 show up as web1/sample3. Due to a number of reasons relocating the content from the root of web3 to web3/sample3 is not an option at this time.

Is there a glaring error in my implementation? If not, what steps can I take to continue troubleshooting this? Thanks in advance!

2
  • 2
    I like to simplify things when debugging these sorts of issues. From the proxy, what is the response if you use curl to fetch web3. In terms of the URL rewrites/relocation, I would handle that on the backened server and not in the proxy. Jan 17, 2014 at 19:16
  • @jeffatrackaid running curl on web1 to fetch web3 works without any issues and returns the entire page. I am not sure what you mean by handling the rewrites on the backend server. Jan 17, 2014 at 19:51

0

You must log in to answer this question.

Browse other questions tagged .