在 AWSEB 命令行上部署 django 应用程序时如何修复 502 Bad Gateway NGINX 错误?

Emm*_*gho 8 python django amazon-elastic-beanstalk bad-gateway

我一直在尝试在awsebcli. 我立即输入eb打开命令,我的网络浏览器返回502 Bad Gateway NGINX错误。请我需要有关如何修复此错误的帮助,为了更好地查看和理解我的代码,屏幕截图位于上传链接中,如下所示。

settings.py

1

502 Bad Gateway

2

.elasticbeanstalk/config.yml

3

.ebextensions\django.config

4

aswebcli status

5

pip freeze命令结果

6

我期待您的友好回复。谢谢

小智 0

对于Python 3.7 Amazon Linux 2 platform for ebs,首先安装gunicorn,然后将其添加到您的requirements.txt中,并将django.config文件编辑为

option_settings: 
  "aws:elasticbeanstalk:application:environment": 
    DJANGO_SETTINGS_MODULE: "elernet.settings" 
    "PYTHONPATH": "/var/app/current:$PYTHONPATH"
  "aws:elasticbeanstalk:container:python": 
    WSGIPath: elernet.wsgi:application 
    NumProcesses: 3 
    NumThreads: 20 
Run Code Online (Sandbox Code Playgroud)

eb 部署
eb 打开