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

python - Setting ctypes.Structure default values -

java - why am i getting a "cannot resolve method" error on getApplication? -

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