[Mongrel] mod_proxy, mongrel, redirect issue

Bill Siggelkow bsiggelkow at mac.com
Wed Aug 20 12:56:00 EDT 2008


This might help ... I have the following rewrite rule in my conf  
file ...

# Redirect all non-static requests to cluster
   RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
   RewriteRule ^/(.*)$ balancer://resman_cluster%{REQUEST_URI} [P,QSA,L]

Also, I have the following :

# Add a special request header so Rails redirects stay on https
   RequestHeader set X_FORWARDED_PROTO "https"

HTH

Bill Siggelkow
bsiggelkow at mac.com
AIM: siggelkowb
Home: 770-457-8854
Mobile: 770-354-2584


On Aug 20, 2008, at 12:45 PM, Jeremy Cavagnolo wrote:

> Hello,
>
> I am configuring apache 2.2 to serve my rails app through mongrel at
> the root of my server.  First, I redirect all http traffic to https
> with the following:
>
> ServerName emiliano
>
> NameVirtualHost *:80
> <VirtualHost *:80>
> 	RedirectPermanent / https://emiliano #this server is only accessed  
> internally
> </VirtualHost>
>
> Inside the <VirtualHost *:443> section, I have the following
> configuration, which seems extremely standard:
>
> <Proxy balancer://mongrel>
>    BalancerMember http://localhost:8000
>    BalancerMember http://localhost:8001
>    BalancerMember http://localhost:8002
> </Proxy>
>
> ProxyRequests Off
> <Proxy *>
>    Order deny,allow
>    Allow from all
> </Proxy>
>
> ProxyPass /stylesheets !
> ProxyPass /javascripts !
> ProxyPass /images !
> ProxyPass / balancer://mongrel/
> ProxyPassReverse / balancer://mongrel/
> ProxyPreserveHost On
>
> When I point my browser to "https://emiliano" I get the login page
> that I expect.  When I submit the login form the authorization is
> properly processed (I checked the access log).  However, my browser is
> then directed to https://emilianousers/home (note the missing "/"
> between hostname and 'users') which of course cannot be found.  If I
> manually insert the slash I am properly directed to the user home
> page.  I can click on links all day long and everything works, but
> when I try to submit any form, the form is processed properly, but the
> same issue with the missing slash returns.
>
> I have tried removing the proxy balancer and going directly to the
> mongrel instance, but I get the same behavior.  I have also removed
> and replaced trailing slashes in my ProxyPass directives with no
> success.
>
> Because I can't seem to find any other documentation of this issue, I
> am left believing that this is a very trivial problem.
>
> Please Help!
>
> jeremy
> _______________________________________________
> Mongrel-users mailing list
> Mongrel-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mongrel-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/mongrel-users/attachments/20080820/1177cd53/attachment.html>


More information about the Mongrel-users mailing list