大地瓜吃番薯 2022-11-28 14:01 采纳率: 100%
浏览 38
已结题

nginx、node

外网访问linux部署的node项目结果
An error occurred.
Sorry, the page you are looking for is currently unavailable.
Please try again later.

If you are the system administrator of this resource then you should check the error log for details.

Faithfully yours, nginx.
nginx报错信息
2022/11/28 05:35:46 [error] 22#22: *35 connect() failed (111: Connection refused) while connecting to upstream, client: 59.61.68.244, server: localhost, request: "GET /shanggs HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "shanggs.top"
2022/11/28 05:35:46 [warn] 22#22: *35 upstream server temporarily disabled while connecting to upstream, client: 59.61.68.244, server: localhost, request: "GET /shanggs HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "shanggs.top"
2022/11/28 05:35:46 [error] 22#22: *35 connect() failed (111: Connection refused) while connecting to upstream, client: 59.61.68.244, server: localhost, request: "GET /shanggs HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "shanggs.top"
2022/11/28 05:35:46 [warn] 22#22: *35 upstream server temporarily disabled while connecting to upstream, client: 59.61.68.244, server: localhost, request: "GET /shanggs HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "shanggs.top"

nginx配置
location /shanggs {
proxy_pass http://localhost:3000/;
}

curl localhost:3000结果

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=vedice-width,initial-scale=1, maximum-sacle=1, user-scalable=no" />
    <title>shanggs</title>
    <style>
      *{
        margin: 0;
        padding: 0;
      }
    </style>
  </head>
  <body>
    <div id="app"></div>
    <!-- built files will be auto injected -->
  <script type="text/javascript" src="/app.js"></script></body>
</html>

网页链接http://shanggs.top/shanggs

  • 写回答

1条回答 默认 最新

  • CSDN-Ada助手 CSDN-AI 官方账号 2022-11-28 17:02
    关注
    • 这篇文章:Nginx笔记 也许能够解决你的问题,你可以看下
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 12月8日
  • 已采纳回答 11月30日
  • 修改了问题 11月28日
  • 创建了问题 11月28日

悬赏问题

  • ¥30 酬劳2w元求合作写文章
  • ¥15 在现有系统基础上增加功能
  • ¥15 远程桌面文档内容复制粘贴,格式会变化
  • ¥15 关于#java#的问题:找一份能快速看完mooc视频的代码
  • ¥15 这种微信登录授权 谁可以做啊
  • ¥15 请问我该如何添加自己的数据去运行蚁群算法代码
  • ¥20 用HslCommunication 连接欧姆龙 plc有时会连接失败。报异常为“未知错误”
  • ¥15 网络设备配置与管理这个该怎么弄
  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图