Just out of curiosity, have you tried proxying your requests from Apache to Mongrel without using the Proxy Balancer?&nbsp; In other words, taking the balancer out of the equation by just:<br><br><div style="margin-left: 40px;">
ProxyPass /rails&nbsp; <a href="http://localhost:3000/">http://localhost:3000/</a><br></div><br>Granted I'm not using SSL, but I am in the process of setting up Apache/mod_proxy/Mongrel and everything works great if I just do a direct ProxyPass.&nbsp; When I try to use the balancer things go haywire...
<br><br>I don't have any answers, I just read your post and noticed that you were using the balancer and having problems.&nbsp; Removing the balancer from the setup might be an interesting troubleshooting exercise...<br><br>Jeremy
<br><br><div><span class="gmail_quote">On 5/10/06, <b class="gmail_sendername">Paul Wright</b> &lt;<a href="mailto:wrighty@gmail.com">wrighty@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On 10/05/06, Zed Shaw &lt;<a href="mailto:zedshaw@zedshaw.com">zedshaw@zedshaw.com</a>&gt; wrote:<br>&gt; On Mon, 2006-05-08 at 15:58 +0100, Paul Wright wrote:<br>&gt; &gt; Hi all,<br>&gt; &gt;<br>&gt; &lt;snip&gt;<br>&gt;
<br>&gt; &gt; I've seen in a few places [1][2] that the trailing slash is important<br>&gt; &gt; on the ProxyPass directive but if I include that then I get a BAD<br>&gt; &gt; CLIENT error in mongrel due to too many&nbsp;&nbsp;slashes:
<br>&gt; &gt;<br>&gt; This is really weird that you have to add the //.&nbsp;&nbsp;That type of URL is<br>&gt; rejected because it violates the actual URI grammar (from what I<br>&gt; understand of it).&nbsp;&nbsp;If balancer needs this, then I'm curious why it's
<br>&gt; bleeding that // to the backend.<br>&gt;<br>&gt; I'll check it out to find out why this is the accepted wisdom.<br><br>I personally don't have to add the trailing slash to the setup and,<br>after going back over the places I saw it mentioned only one of them
<br>claimed it needed to be there.&nbsp;&nbsp;The other was warning against it.&nbsp;&nbsp;So<br>just discard the above.&nbsp;&nbsp;I think.<br><br>&gt; &gt; The two main problems I have now is that all rendered links are<br>&gt; &gt; missing the sub-directory and if any redirects are issued then they
<br>&gt; &gt; are for <a href="http://admin.example.com:12345/">http://admin.example.com:12345/</a> instead of the ssl version<br>&gt; &gt; <a href="https://admin.example.com:12345/">https://admin.example.com:12345/</a> - is this because mongrel/rails is
<br>&gt; &gt; only seeing a http request?&nbsp;&nbsp;And if so is it possible to let the app<br>&gt; &gt; know that it's actually https and in a subdirectory?<br>&gt;<br>&gt; I'll have to look at this.&nbsp;&nbsp;It might be that mongrel will have to detect
<br>&gt; that the request was secured and add the https, but I really think Rails<br>&gt; should do this since this is where the redirect is generated.<br>&gt;<br>&gt; Take a look at the headers that Mongrel receives and see if you are
<br>&gt; getting the header that indicates the request was secured.&nbsp;&nbsp;If you are<br>&gt; then Rails must not be honoring it.&nbsp;&nbsp;If not then you need to tell your<br>&gt; web server to start sending it.<br><br>Having run mongrel in debug mode I've looked at the headers and
<br>there's nothing there to suggest that Apache has proxied a https<br>connection.&nbsp;&nbsp;Looking through the Rails source[1] I see that there are<br>two situations where Rails will generate https links<br><br>153&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; def ssl?
<br>154&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @env['HTTPS'] == 'on' || @env['HTTP_X_FORWARDED_PROTO'] == 'https'<br>155&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br><br>I had thought that I could used the [E=VAR:VAL] flag on a Rewrite rule<br>but then I remembered that we're proxying to an independant http
<br>server (mongrel) so it wouldn't make it across.&nbsp;&nbsp;I've got it working<br>by adding RequestHeader directive to my Rewrite rules:<br><br>RewriteEngine On<br># Punt any pontential 404s to the proxy<br>RewriteCond %{REQUEST_FILENAME} ^/rails/.*
<br>RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f<br>RequestHeader set X_FORWARDED_PROTO 'https'<br>RewriteRule ^/rails/(.*)$ balancer://proxy_group/$1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[proxy]<br><br>(I don't know apache well enough to know whether the RequestHeader
<br>will fire only apply when the RewriteCond or for every request to this<br>VirtualHost but I'm confident it won't hurt non-rails requests.)<br><br>All that's left now is working out how to set the environment variable<br>
RAILS_RELATIVE_URL_ROOT...&nbsp;&nbsp;Any clues?<br><br>Paul.<br><br>[1] - <a href="http://dev.rubyonrails.org/browser/trunk/actionpack/lib/action_controller/request.rb">http://dev.rubyonrails.org/browser/trunk/actionpack/lib/action_controller/request.rb
</a><br><br>_______________________________________________<br>Mongrel-users mailing list<br><a href="mailto:Mongrel-users@rubyforge.org">Mongrel-users@rubyforge.org</a><br><a href="http://rubyforge.org/mailman/listinfo/mongrel-users">
http://rubyforge.org/mailman/listinfo/mongrel-users</a><br></blockquote></div><br>