【问题标题】:502 Bad Gateway nginx/1.14.0 (Ubuntu) Error502 Bad Gateway nginx/1.14.0 (Ubuntu) 错误
【发布时间】:2019-03-27 18:00:45
【问题描述】:

我最近使用 Ubuntu 和 Docker 和 Nginx 制作了一个 droplet。我将我的 prisma react 原生项目部署到了​​ droplet,一切正常。

我使用sudo shutdown -r now 关闭了我的Droplet,当Droplet 重新启动而不是显示Graphql Playground 的Droplet IP 地址时,我现在看到502 Bad Gateway nginx/1.14.0 (Ubuntu)

运行命令sudo tail -5 /var/log/nginx/error.log 显示错误

2019/03/27 17:17:44 [错误] 10099#10099: *5 connect() 在连接到上游时失败(111:连接被拒绝),客户端:172.218.13.88,服务器:_,请求:“ GET / HTTP/1.1”,上游:“http://127.0.0.1:4000/”,主机:“68.183.202.55”

我使用sudo systemctl status nginx 检查了 Nginx 状态,一切似乎都正常,除了有一行写着nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument。我不确定这是否重要。

【问题讨论】:

    标签: ubuntu nginx digital-ocean


    【解决方案1】:

    Nginx 运行良好,但无法再连接到端口 4000 上的上游服务器(您的 GraphQL 服务器)。

    确保您的 GraphQL 后端已使用 init 文件正确设置,并且在 droplet 启动时启动。

    【讨论】:

      猜你喜欢
      • 2022-08-16
      • 2017-06-29
      • 2016-09-14
      • 2018-04-23
      • 2020-04-05
      • 1970-01-01
      • 1970-01-01
      • 2022-01-24
      • 2018-11-12
      相关资源
      最近更新 更多