[Mongrel] Nginx, Mongrel, Proxy and REMOTE_ADDR
jgeiger at gmail.com
Wed Nov 1 11:26:43 EST 2006
I'm using a cluster of mongrels behind an apache 1.3 proxy pass. I've
been passing the request to pen, which in turn balances the cluster of
mongrels. Now, I'd like to be able to use a different server to send
the static files created by the rails application, so I tried to
replace pen with nginx. Everything seems to work fine except the
environment variable REMOTE_ADDR.
When I do a <%= request.env["REMOTE_ADDR"] %> with pen balancing, it
sends in the proper (and expected) 192.168.1.21.
When nginx is the balancer, the output becomes: 192.168.1.21, 127.0.0.1.
the nginx proxy information I have set is:
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Just wondering if anyone else has run into this problem, and it's
More information about the Mongrel-users