nginx匹配get参数和判断ua

需求:当get参数中social_platform=wechat_circle并且在微信打开时,跳转到新页面
http://m.iqiyi.com/v_19rqv5hs78.html?social_platform=wechat_circle

location ~* ^/(w|v)_.*$ {
        set $flag 0;
        if ($arg_social_platform = "wechat_circle") {
            set $flag "${flag}1";
        }
        if ($http_user_agent ~* "MicroMessenger") {
            set $flag "${flag}2";
        }
        if ($flag = "012") {
            proxy_pass  [http://vue](http://vue)_qae;
        }
        proxy_pass http://10.110.117.55:80;
    }

你可能感兴趣的:(nginx匹配get参数和判断ua)