Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We are receiving a 500 out of Apache while proxying calls to tomcat when there is an encoded space in the URL.

We are migrating an application that ran fine on a J2EE container which had an older, integrated version of Apache (1.x), but as soon as we moved the application to Tomcat + Apache 2 + mod_proxy, we began seeing the error.

For instance:  works fine fails with a 500

The request works fine if we hit tomcat directly, and we know that it is not reaching the servlet when going through Apache.

Proxy configuration is as follows for the server that lives on

ProxyPass /app ajp://
ProxyPassReverse /app ajp://

We tried switching to HTTP rather than AJP with no change in the error.

The leading theory is that mod_proxy is decoding the %20 and then expecting to see other HTTP header info rather than the remaining URL substring and is resulting in a 500. If this is the case, does anyone have a workaround that does not involve rewriting the app. If this is not the cause, does anyone have a suggestion as to what it could be?

I have seen no documentation or bug reports of this exact symptom in my searches.

Thanks in advance.

share|improve this question
Interesting. I'm curious if the error still occurs if you use an http:// proxy instead of the ajp://? That module can be a little problematic. Also, anything in the apache error.log? – Shane Madden Jun 8 '11 at 15:28
We tried using http:// and it still failed with the same error. Nothing in the error log either – Matt Franklin Jun 8 '11 at 16:13

Does adding 'nocanon' to your ProxyPass rule work?

i.e. ProxyPass /app ajp:// nocanon

From the docs:

Normally, mod_proxy will canonicalise ProxyPassed URLs. But this may be incompatible with some backends, particularly those that make use of PATH_INFO. The optional nocanon keyword suppresses this, and passes the URL path "raw" to the backend. Note that may affect the security of your backend, as it removes the normal limited protection against URL-based attacks provided by the proxy.

share|improve this answer

Your Answer


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.