gourl.yohobuy.com.conf 2.64 KB
server
{
   listen       80;
   server_name  gourl.yohobuy.com;

   set $wapFlag 0;

   if ( $http_user_agent ~ "(MIDP)|(WAP)|(UP.Browser)|(Smartphone)|(Obigo)|(Mobile)|(AU.Browser)|(wxd.Mms)|(WxdB.Browser)|(CLDC)|(UP.Link)|(KM.Browser)|(UCWEB)|(SEMC-Browser)|(Mini)|(Symbian)|(Palm)|(Nokia)|(Panasonic)|(MOT-)|(SonyEricsson)|(NEC-)|(Alcatel)|(Ericsson)|(BENQ)|(BenQ)|(Amoisonic)|(Amoi-)|(Capitel)|(PHILIPS)|(SAMSUNG)|(Lenovo)|(Mitsu)|(Motorola)|(SHARP)|(WAPPER)|(LG-)|(LG/)|(EG900)|(CECT)|(Compal)|(kejian)|(Bird)|(BIRD)|(G900/V1.0)|(Arima)|(CTL)|(TDG)|(Daxian)|(DAXIAN)|(DBTEL)|(Eastcom)|(EASTCOM)|(PANTECH)|(Dopod)|(Haier)|(HAIER)|(KONKA)|(KEJIAN)|(LENOVO)|(Soutec)|(SOUTEC)|(SAGEM)|(SEC-)|(SED-)|(EMOL-)|(INNO55)|(ZTE)|(iPhone)|(Android)|(Windows CE)|(Wget)|(Java)|(curl)|(Opera)" )
   {
       set $wapFlag 1;
   }

    location / {
        return 302 http://www.yohobuy.com$request_uri;
    }

    location ^~ /special/786_ {
        if ($wapFlag = 1) {
            return 302 https://feature.yoho.cn/0309/0309ITEMBOY/index.html?$query_string;
        }
        proxy_redirect off;
        proxy_pass http://yohobuy-node;
        proxy_set_header   Host   $host;
        proxy_set_header   X-Real-IP  $http_x_forwarded_for;
        proxy_set_header   X-Yoho-Real-IP  $http_x_forwarded_for;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   Accept-Encoding "gzip";
        proxy_http_version  1.1;
        proxy_set_header   Connection "";
    }

    location ^~ /special/788_ {
        if ($wapFlag = 1) {
            return 302 https://feature.yoho.cn/0309/0309ITEMGIRL/index.html?$query_string;
        }
        proxy_redirect off;
        proxy_pass http://yohobuy-node;
        proxy_set_header   Host   $host;
        proxy_set_header   X-Real-IP  $http_x_forwarded_for;
        proxy_set_header   X-Yoho-Real-IP  $http_x_forwarded_for;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   Accept-Encoding "gzip";
        proxy_http_version  1.1;
        proxy_set_header   Connection "";
    }

    location ^~ /special/774_ {
        if ($wapFlag = 1) {
            return 302 https://feature.yoho.cn/0301/NEWTRENDBOY/index.html?$query_string;
        }
        proxy_redirect off;
        proxy_pass http://yohobuy-node;
        proxy_set_header   Host   $host;
        proxy_set_header   X-Real-IP  $http_x_forwarded_for;
        proxy_set_header   X-Yoho-Real-IP  $http_x_forwarded_for;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   Accept-Encoding "gzip";
        proxy_http_version  1.1;
        proxy_set_header   Connection "";
    }

}