[Mongrel] OT(?): ReverseProxy and URLs

Stan Baptista stan.baptista at gmail.com
Wed Feb 21 21:21:51 EST 2007

This could be OT. If so, just let me know and I apologize in advance.

I mentioned in an earlier email that I have Mongrel setup as a proxy server
behind Apache. Rails applications served by Mongrel do not find the CSS file
and hence no styles are displayed. In fact, many of the actions are not
found.The reason, I believe, is because the URLs for styles and actions
typically follow this pattern:

<!-- Style sheets -->
<link href="/stylesheets/style.css?1171939096" media="screen"
rel="Stylesheet" type="text/css" />

(Note the first '/'.)

When accessing a Rails app directly via a port# (
things are fine, but not so when accessing via Apache (

Presumably, in this case, it's looking for the style sheet in the Apache
webroot and failing.

I'm fairly sure this is a ReverseProxy problem and also suspect it's not
uncommon. Before investigating too deeply, I wonder if some of you have
already found solutions.

The Apache httpd.conf VirtualHost directives are these:



    RewriteEngine on
    RewriteRule ^/rss(.*)$1 [P]
    RewriteRule ^/railstest(.*)$1 [P]



    ServerName rss
    ProxyPass /
    ProxyPassReverse /rss
    ProxyPreserveHost on



    ServerName railstest
    ProxyPass /
    ProxyPassReverse /railstest
    ProxyPreserveHost on


Any help, as always, is appreciated.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20070221/53f66c4d/attachment.html 

More information about the Mongrel-users mailing list