location /api/v1 {
        set $is_matched 0;
        if ($request_uri ~ /api/v1/user/100001/ ) {
            proxy_pass https://127.0.0.1:1001/;
            set $is_matched 1;
        }
        
        if ($request_uri ~ /api/v1/user/100002/ ) {
            proxy_pass https://127.0.0.1:1001/;
            set $is_matched 1;
        }

        # 没有匹配到,跳转到默认页面
        if ($is_matched = 0) {
            proxy_pass https://127.0.0.1:8080;
        }
        
    }

83 total views, 1 views today

发表评论

电子邮件地址不会被公开。 必填项已用*标注