方案一:rewrite 重定向 location /faceAuth { rewrite "^/faceAuth/(.*)$" https://aip.baidubce.com/$1 break; } 只能代理get请求 方案二:return 307 http强制跳转https location /faceAuth { if ($request_uri ~* ^/faceAuth/(.*)$) { return 307 https://aip.baidubce.com/$1; } }