外网访问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>