大地瓜吃番薯 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日

悬赏问题

  • ¥20 西门子S7-Graph,S7-300
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改