You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Nginx Proxy Manager无法代理同VPS本地应用求助

问题:Nginx Proxy Manager代理本地.NET Core应用出现502错误

环境与现状

  • 已在Oracle Cloud的Ubuntu VPS上通过默认Docker Compose部署Nginx Proxy Manager(NPM),可通过公网IP+81端口正常访问管理后台并创建代理主机
  • VPS上运行着一个.NET Core Web应用,以服务形式启动,监听地址为127.0.0.1:5050;在VPS本地执行curl http://localhost:5050或curl http://127.0.0.1:5050可正常获取页面内容,但使用VPS私有IP或主机名执行curl http://{private_ip}:5050或curl http://{hostname}:5050时提示连接拒绝
  • 此前使用原生Nginx配置可成功实现该应用的代理,配置片段如下:
server_name test.example.com;

location /
{
        proxy_pass http://127.0.0.1:5050/;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
}

操作步骤与问题

  1. 在DNS服务商处将test.example.com解析至VPS公网IP
  2. 在NPM中创建代理主机:域名设置为test.example.com,协议选择http,转发地址先后尝试过localhost、127.0.0.1、VPS私有IP、主机名,转发端口均设为5050
  3. 访问test.example.com时,始终返回**502 Bad Gateway(openresty)**错误

疑问

  • NPM是否支持代理同VPS上的本地应用?
  • 是否是对NPM与Docker网络的理解存在偏差?

内容的提问来源于stack exchange,提问作者Telstar

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.17 11:07:35