<br><br><div><span class="gmail_quote">On 7/10/06, <b class="gmail_sendername">Zed Shaw</b> <<a href="mailto:zedshaw@zedshaw.com">zedshaw@zedshaw.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>I imagine previously that's what your apache config with fastcgi was<br>doing. There just isn't any other way to do it outside of rails. This<br>also means that your previous config was horribly inefficient.<br><br>
Snoop around on the interwebs and google for this magic config. I'm<br>pretty sure I'm not crazy, but it's something like:</blockquote><div><br>ActionController::AbstractRequest.relative_url_root = "/myappliveshere". Amazingly enough, it's special-cased for Apache with FastCGI--if it spots dispatch.[f]cgi in the right environment variable, then it sets relative_url_root automatically. That's why it works with Apache most of the time :-). That's the magic I was missing this morning.
<br><br>So, if you add relative_url_root to environment.rb (or $RELATIVE_URL_ROOT to the environment) to '/blog', then you can proxy from <a href="http://real-server:80/blog">http://real-server:80/blog</a> to <a href="http://localhost:4123/">
http://localhost:4123/</a> (running Mongrel) and all of the generated URLs work. But, you won't be able to access the backend directly for debugging, because it'll be expecting urls that start at / and generating urls that start with /blog/.
<br><br>I have a little patch that adds a --prefix flag to Mongrel that sets the Rails handler URI as well as relative_url_root. As I mentioned above, it's not strictly needed, but it'll make life a bit easier for people. Would this be something that you'd be interested in applying, or should I go tweak the Typo docs to explain it away?
<br><br><br>Scott<br></div></div><br>