2

问题总结

  • 访问我的实时站点时出现“<strong>502 Bad Gateway - nginx/1.14.0 (Ubuntu)”错误。
  • 只能通过开发服务器端口访问站点:python3 manage.py runserver 0.0.0.0:8080
  • 然后我可以通过 www.myproject.com:8080 访问我的网站,一切正常
  • 我相信这与 gunicorn 无法为我的项目服务有关

技术

  • 蟒蛇3
  • django 版本 2.1.2
  • 数码海洋

直至出错点的工作流程

  • 在数字海洋上创建了一个水滴 - 遵循本指南https://www.youtube.com/watch?v=Y-CT_l1dnVU&t=958s
  • 似乎该指南的评论部分中的许多人都遇到了同样的问题
  • 使用数字海洋的一键安装 django
  • 在上传我的项目文件之前,我检查了实时站点以查看一切正常。
  • 上传了我的项目文件并升级了 django
  • 再次检查实时站点,得到“502 Bad Gateway”错误 502 错误
  • 尝试切换回旧版本的 django,这不是问题
  • 遵循本指南:https : //www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04 发现我的gunicorn守护进程无法启动
  • sudo nano /etc/systemd/system/gunicorn.service gunicorn.service
  • gunicorn的检查状态sudo systemctl status gunicorn 未能启动
  • 检查的错误日志:sudo journalctl -u gunicorn 错误日志

任何帮助将不胜感激

项目文件 目录

4

0 回答 0