Hello,
I have configured nginx load balacer default round robin method, works fine. Now i wanted to configure load balancing based on region. say request coming from US then serve pages from server A and Request coming from Asia then serve pages from different servers.
Can someone send me how to URL or steps to follow to setup requirement, here is my config file,
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
geo $geo {
default default;
include geo.conf;
}
upstream default.backend {
server 1.2.3.4:8080 weight=2;
server 5.6.7.8:8080;
}
upstream UK.backend {
server 1.2.3.4:8080;
}
upstream DE.backend {
server 5.6.7.8:8080;
}
server {
listen 80;
server_name serversreview.net;
location / {
proxy_pass http://$geo.backend;
}
}
}
Thanks,
Ramesh
I have configured nginx load balacer default round robin method, works fine. Now i wanted to configure load balancing based on region. say request coming from US then serve pages from server A and Request coming from Asia then serve pages from different servers.
Can someone send me how to URL or steps to follow to setup requirement, here is my config file,
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
geo $geo {
default default;
include geo.conf;
}
upstream default.backend {
server 1.2.3.4:8080 weight=2;
server 5.6.7.8:8080;
}
upstream UK.backend {
server 1.2.3.4:8080;
}
upstream DE.backend {
server 5.6.7.8:8080;
}
server {
listen 80;
server_name serversreview.net;
location / {
proxy_pass http://$geo.backend;
}
}
}
Thanks,
Ramesh