当前位置: 首页 > news >正文

nginx代理后502

直接访问 ​https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions正常

使用nginx代理后访问出现502

    server {listen       9999;server_name  172.21.3.78;location ^~ /compatible-mode {proxy_pass https://dashscope.aliyuncs.com;}location / {proxy_pass http://172.21.3.78:9993;}}

21#21: *5 peer closed connection in SSL handshake (104: Connection reset by peer) while SSL handshaking to upstream, client: 10.10.10.1, server: 172.21.3.78, request: "POST /compatible-mode/v1/chat/completions HTTP/1.1", upstream: "https://47.93.243.29:443/compatible-mode/v1/chat/completions", host: "172.21.3.78:9999"

原因:

在请求时DNS域名进行解析,实际请求出去的是IP与端口,但对方系统是多个域名对应一个公网IP,这个公网IP下映射到了多个项目和服务,通过nginx的server_name进行区分,所以直接请求不通。
 

解决方法:

添加 proxy_ssl_server_name on;

    server {listen       9999;server_name  172.21.3.78;location ^~ /compatible-mode {proxy_ssl_server_name on;proxy_pass https://dashscope.aliyuncs.com;}location / {proxy_pass http://172.21.3.78:9993;}}

http://www.lryc.cn/news/542546.html

相关文章:

  • 大模型WebUI:Gradio全解12——LangChain原理及其agent构建Gradio(1)
  • 【Unity】鱼群效果模拟
  • PHP入门基础学习五(函数1)
  • 微信小程序 - 页面跳转(wx.navigateTo、wx.redirectTo、wx.switchTab、wx.reLaunch)
  • Typora的Github主题美化
  • 2.3 变量
  • Docker:Docker从入门到精通(一)- Docker简介
  • 【复习】Redis
  • 在Spring Boot+Vue前后端分离的项目中使用JWT实现基本的权限校验
  • 蓝桥杯单片机组第十二届省赛第二批次
  • 伪404兼容huawei生效显示404
  • UIAutomation开发常用方法的参考文档
  • 数据库面试题(基础常考!!!)
  • ASP.NET Core Clean Architecture
  • 蓝桥杯备赛-精卫填海-DP
  • Windows10配置C++版本的Kafka,并进行发布和订阅测试
  • vue3 下载文件 responseType-blob 或者 a标签
  • 【Gin-Web】Bluebell社区项目梳理6:限流策略-漏桶与令牌桶
  • 51单片机-AT24CXX存储器工作原理
  • 突破性能极限:DeepSeek开源FlashMLA解码内核技术解析
  • 点击修改按钮图片显示有问题
  • [AI]从零开始的树莓派运行DeepSeek模型教程
  • 2024-2025 学年广东省职业院校技能大赛 “信息安全管理与评估”赛项 技能测试试卷(二)
  • Open WebUI本地部署教程
  • Missing required prop: “maxlength“
  • dify本地部署
  • python学习一
  • git branch
  • 算法-图-数据结构(邻接矩阵)-BFS广度优先遍历
  • 数学建模之数学模型—2:非线性规划