[Mongrel] OT(?): ReverseProxy and URLs

Joey Geiger jgeiger at gmail.com
Thu Feb 22 09:21:32 EST 2007


You're going to run into issues because you want to access your
application from both urls (with the port and without).

If you just chose to use the /rss, you could start mongrel with the
app prefix /rss, which would be a start. I'm not sure if you also need
to add /rss to the end of your proxy and reverse proxy statements.

On 2/21/07, Stan Baptista <stan.baptista at gmail.com> wrote:
> 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:
>
> NameVirtualHost 10.4.1.84
>
> <VirtualHost 10.4.1.84>
>
>     RewriteEngine on
>     RewriteRule ^/rss(.*) http://10.4.1.84:5222$1 [P]
>     RewriteRule ^/railstest(.*) http://10.4.1.84:8223$1 [P]
>
> </VirtualHost>
>
> <VirtualHost 10.4.1.84>
>
>     ServerName rss
>     ProxyPass / http://10.4.1.84:5222/
>     ProxyPassReverse /rss http://10.4.1.84:5222/
>     ProxyPreserveHost on
>
> </VirtualHost>
>
> <VirtualHost 10.4.1.84>
>
>     ServerName railstest
>     ProxyPass / http://10.4.1.84:8223/
>     ProxyPassReverse /railstest http://10.4.1.84:8223/
>     ProxyPreserveHost on
>
> </VirtualHost>
> Any help, as always, is appreciated.
>
> Thanks,
> Stan
>
> _______________________________________________
> Mongrel-users mailing list
> Mongrel-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mongrel-users
>


More information about the Mongrel-users mailing list