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

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -