Apache + mongrel cluster: early unescaping of URI by Apache

Hello all,

I have run into a weird problem.

I have the following route:

map.show_wiki_page ‘wiki/show/:name/:version’, :action => ‘show’ , :version => nil, :requirements => {:version => /\d+/, :name => /[\d \w?!,()[]]+/}

If I run a bare mongrel (my dev environment) and access my app with http://myhost/wiki/show/Waarom+deze+wiki+%3F%3F,

my params are {“name”=>“Waarom deze wiki ??”, “action”=>“show”, “controller”=>“wiki”}, which is exactly what I expect, but

in my production environment (apache 2.2.3 + mod_proxy + mongrel cluster) my params hash is

{“name”=>"Waarom deze wiki ", “action”=>“show”, “controller”=>“wiki”, “?”=>nil} which is incorrect.

Looking into request headers here’s what I have found out:

Bare mongrel:

“REQUEST_URI” =>"/wiki/show/Waarom+deze+wiki+%3F%3F"

“PATH_INFO” =>"/wiki/show/Waarom+deze+wiki+%3F%3F"

“REQUEST_PATH” =>"/wiki/show/Waarom+deze+wiki+%3F%3F"

Apache + mongrel cluster:

“REQUEST_URI” => “/wiki/show/Waarom+deze+wiki+??”

“PATH_INFO” => “/wiki/show/Waarom+deze+wiki+”

“REQUEST_PATH” => “/wiki/show/Waarom+deze+wiki+”

Looking at REQUEST_URI of the production environment I am wondering why Apache unescaped the URI before sending

it to mongrels.

The rewriting rule is standard and used by other similar setups, as far as I know:

Redirect all non-static requests to cluster

RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f

RewriteRule ^/(.*)$ balancer://portal_cluster%{REQUEST_URI} [P,QSA,L]

Does anyone have similar experience? Where should I be looking to change this behavior?

Thank you!

Production box: Debian stable

Mongrel 1.1.1

Rails 1.2.5

apache 2.2.3

Best regards,

Yuri Leikind

hi yuri!

Yuri Leikind [2008-03-03 16:31]:

Does anyone have similar experience? Where should I be looking to
change this behavior?

we had a similar issue which i gladly solved today. here's what i
needed to change to make it work:
<http://prometheus.khi.uni-koeln.de/trac/pandora/changeset/555>

see the references there for more information; particularly,
<https://issues.apache.org/bugzilla/show_bug.cgi?id=34602#c16>.

hope that helps with your problem, too :wink:

cheers
jens