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

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日