Bug 41614 - Certain types of encoding generate proxy errors
Summary: Certain types of encoding generate proxy errors
Status: RESOLVED DUPLICATE of bug 39746
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_proxy_balancer (show other bugs)
Version: 2.2.3
Hardware: Other other
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Depends on:
Reported: 2007-02-14 12:26 UTC by Mark
Modified: 2007-09-08 17:57 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Mark 2007-02-14 12:26:32 UTC
We have Apache 2.2.3 using mod_proxy_balancer to send requests to a mongrel
backend cluster for rails apps. We have some mod rewrite in effect that help
sort what goes to the balancer and what gets served directly by apache. When
sending requests to the balancer for the rails app, sometimes Apache reports :

Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /articles/show/127129-Global
Conference? test? test.

Reason: Error reading from remote server

"/articles/show/127129-Global Conference? test? test" is the actual URL. The
portion beyond 127129 is the title of the article. 

Mod_rewrite reports that it sends to the balancer this: 

"articles/show/127129-Global Conference" with args = "test? test" 

The actual encoding looks like this: 


Note here that the rails app only needs the portion up to 127129, the rest is
appended to the URL for search engine optimization purposes - so links on Web
pages contain a URL similar to the one above. 

Seems as though somewhere along the line mod_proxy_balancer doesn't like the
encoding. We can connect directly to the mongrel server using Lynx and pass the
URL and get a correct response. But going through Apache and the balancer we get
the error cited above.  

What we found in trying to debug this is that if the space char (%20) is removed
then the balancer will return the requested content (since the rails app doesn't
care much about what other chars are beyond the number in the URL).
Comment 1 Mark 2007-02-15 14:16:18 UTC
Here's another sample URL that results in "Not Found" from mongrel (serving the
Rails app with Apache as the reverse proxy frontend) which means that Apache
with mod_proxy_balancer somehow doesn't like the encoded forward slash char
(%2F). If we remove that / char (as encoded), the URL works fine. 

Actual URL looks like this

Comment 2 Mark 2007-02-15 14:30:25 UTC
Forgot to mention that in that last example with the forward slash encoded char,
Apache sends the request to mongrel, but it's returned as not found. However
using the encoded URL via wget directly to the mongrel server works fine.
Somewhere along the line Apache is messing up the request. 
Comment 3 Nick Kew 2007-09-08 17:57:08 UTC

*** This bug has been marked as a duplicate of 39746 ***