[Mongrel] OT(?): ReverseProxy and URLs
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# (http://10.4.1.84:5222)
things are fine, but not so when accessing via Apache (http://10.4.1.84/rss
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:
RewriteRule ^/rss(.*) http://10.4.1.84:5222$1 [P]
RewriteRule ^/railstest(.*) http://10.4.1.84:8223$1 [P]
ProxyPass / http://10.4.1.84:5222/
ProxyPassReverse /rss http://10.4.1.84:5222/
ProxyPass / http://10.4.1.84:8223/
ProxyPassReverse /railstest http://10.4.1.84:8223/
Any help, as always, is appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mongrel-users