load balancing - Setup dynamic upstream with nginx -


suppose have upstream source

upstream first { }  upstream second { } 

and in server block

map $geoip_country_code $is_china {     default no;     cn yes; } 

what achieve if $is_china, use different upstream

proxy_pass http://$preferred_host/; 

i can't figure how nginx.

map might sufficient. have tried following?

map $geoip_country_code $preferred_host {     default first;     cn      second; } 

Comments

Popular posts from this blog

c++ - list<myClass<int> * > sort -

c - Defining floating point constants, how many digits are useful? -

C# Apple Bonjour - how to monitor service records within Windows -