你这配置错误了,阿里云那边设置了服务器名称指示Server Name Indication, SNI验证,SNI 是 TLS 协议的扩展,允许客户端在握手过程中发送请求的服务器名称,这样服务器可以正确地选择相应的证书进行响应,如果不发域名信息,阿里云无法匹配正确的证书,所有通过proxy_ssl_server_name 来开启发送,proxy_ssl_server_name是 Nginx 中的一个指令,用于在代理 HTTPS 请求时启用或禁用服务器名称指SNI。
修改配置如下
proxy_pass https://dashscope.aliyuncs.com/; proxy_set_header Host dashscope.aliyuncs.com; proxy_set_header Authorization "Bearer sk-6111111111"; proxy_ssl_server_name on; proxy_buffering off;
网友回复