nginx load balancer with geoip?

Francis Daly francis at
Sun Mar 4 09:23:06 UTC 2012

On Fri, Mar 02, 2012 at 10:46:20PM -0500, delphixe2 wrote:

Hi there,

you've found something that works for you, so you can stay with that


> I tried that, and I get 500 Internal Server Error.

I find that it is usually worth understanding *why* configurations fail,
so it might be worth investigating happened there.

> and more lines what I tested :
> proxy_set_header   X-Real-IP  $remote_addr;
> proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;

They can be useful if the proxied server is configured to care about them.

> temporarily, I solved problem.
> upstream {
> server;
> }
> upstream {
> server;
> }
> location / {
> proxy_pass http://$;
> }
> and I added record for ->'s server
> IP & ->'s IP

Perhaps responds differently based on the source address; but
from where I am, it looks like you have a redirector, not a reverse proxy.

When I access the IP address of, if I make a http request
with anything other than a Host: header of "", I get a 302
redirect to

So to get useful content back in a proxy_pass location, I'd need to set
the correct Host header.

All the best,

Francis Daly        francis at

More information about the nginx mailing list