events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
geoip_city GeoLiteCity.dat;
server 59.151.X.X;
}
upstream dianxin {
server 75.125.X.X;
}
upstream USA {
server www.google.cn;
}
server {
listen 80;
server_name 75.125.197.200;
root html;
index index.html index.htm;
if ($geoip_region ~ "(01|02|03|04|06|07|11|13|14|15|16|21|23|29|30|31|32|33)") {
proxy_pass http://dianxin$request_uri;
}
if ($geoip_region ~ "(05|08|09|10|12|17|18|19|20|24|25|26)") {
proxy_pass http://wangtong$request_uri;
}
if ($geoip_city_country_code ~ "US") {
proxy_pass http://USA$request_uri;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
CN,02,"Zhejiang"
CN,03,"Jiangxi"
CN,04,"Jiangsu"
CN,05,"Jilin"
CN,06,"Qinghai"
CN,07,"Fujian"
CN,08,"Heilongjiang"
CN,09,"Henan"
CN,10,"Hebei"
CN,11,"Hunan"
CN,12,"Hubei"
CN,13,"Xinjiang"
CN,14,"Xizang"
CN,15,"Gansu"
CN,16,"Guangxi"
CN,18,"Guizhou"
CN,19,"Liaoning"
CN,20,"Nei Mongol"
CN,21,"Ningxia"
CN,22,"Beijing"
CN,23,"Shanghai"
CN,24,"Shanxi"
CN,25,"Shandong"
CN,26,"Shaanxi"
CN,28,"Tianjin"
CN,29,"Yunnan"
CN,30,"Guangdong"
CN,31,"Hainan"
CN,32,"Sichuan"
CN,33,"Chongqing"
- $geoip_city_country_code; - two-letter country code, for example, "RU", "US".
- $geoip_city_country_code3; - three-letter country code, for example, "RUS", "USA".
- $geoip_city_country_name; - the name of the country, for example, "Russian Federation", "United States".
- $geoip_region; - the name of region (province, region, state, province, federal land, and the like), for example, "Moscow City", "DC".
- $geoip_city; - the name of the city, for example, "Moscow", "Washington".
- $geoip_postal_code; - postal code.