I'm in the process of setting up a mongrel cluster at the moment, and I'm
running into a bit of an issue. Even worse is that I'm not sure whether
this is a mongrel thing, or an Apache thing. While I'm inclined to think
that this might be a balancer thing, I decided there was a higher chance
hearing back from mongrel-users than from apache-users, so I'd try this
list first.
So, I'm using mongrel 0.3.13.4 with cluster 0.2.1 running rails 1.1.6 on
ruby 1.8.5, and the following Apache (v2.2.4) configuration for the
virtual host (domain and usernames changed):
<VirtualHost *:443>
ServerName server.domain.com:443
ServerAdmin [EMAIL PROTECTED]
DocumentRoot /home/desq/deployment/current
#RequestHeader set X_FORWARDED_PROTO 'https'
<Directory "/home/user/deployment/current">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Proxy balancer://mongrel_cluster>
BalancerMember http://127.0.0.1:3000
BalancerMember http://127.0.0.1:3001
</Proxy>
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^/$ /index.html [QSA]
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI}
[P,QSA,L]
CustomLog logs/desq-access.log common
ErrorLog logs/desq-error.log
SSLEngine on
SSLCertificateFile /home/user/ssl.crt
SSLCertificateKeyFile /home/user/ssl.key
</VirtualHost>
<VirtualHost *:80>
ServerName server.domain.com
Redirect permanent / https://server.domain.com
</VirtualHost>
Also, the cluster YML file:
---
port: 3000
pid_file: log/mongrel.pid
servers: 2
address: 127.0.0.1
cwd: /home/user/deployment/current
user: user
group: user
environment: production
Now (almost) everything works perfectly. Sessions are great, requests are
passed on, spread between the instances of mongrel. Sadly, HTTP redirects
are not correctly passed somewhere.
If I were to connect to the mongrel instances on port 3000 or 3001
directly, the HTTP redirects are correctly processed. With the balancer,
it's not.
For example, if going to https://server.domain.com:3000/admin/home
redirects to https://server.domain.com:3000/users/login (works without
balancer), then going to https://server.domain.com/admin/home redirects to
https://server.domain.comusers/login (missing the "/" between the host
name and the request URI, thus not working with balancer).
I would appreciate any comments or suggestions on how to further hunt this
issue down.
Cheers,
-RP
_______________________________________________
Mongrel-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/mongrel-users