AWS部署的Django应用程序

时间:2020-06-17 05:15:04

标签: django amazon-web-services

我有一个已部署在AWS中的Django应用程序。 ec2实例中的URL也可以正常加载。 我的应用程序有一个模式,应在其中输入团队名称和用户名。每当我尝试 [ec2instanceurl]:8000 / (当我启动gunicorn)时,我都不会遇到任何警告错误。

但是,当我启动nginx并访问不带port(8000)的URL时,页面正在加载,并且每当我以模式输入详细信息并单击“确认”按钮时,它就会显示警告“'[ec2instanceurl]说错误”

我将在此处附加错误捕捉

我想知道这是我的django应用程序错误还是任何AWS设置错误。 事实是,它可以在本地和古尼康港口正常工作。enter image description here

尽管Iam是AWS部署的新手,但IAM希望获得建议。 预先感谢

nginx配置文件(/ etc / nginx / sites-available)

server {
  listen 80;
  server_name ec2-34-232-78-132.compute-1.amazonaws.com;

  location / {
     include proxy_params;
      proxy_pass http://unix:/home/ubuntu/rest_project/app.sock;
    }
}

gunicorn conf文件

[program:gunicorn]
directory=/home/ubuntu/rest_project
command=/home/ubuntu/env/bin/gunicorn --workers 3 --bind unix:/home/ubuntu/rest_project/app.sock rest_project.wsgi:application
autostart=true
autorestart=true
stderr_logfile=/var/log/gunicorn/gunicorn.err.log
stdout_logfile=/var/log/gunicorn/gunicorn.out.log

[group:guni]
programs:gunicorn

nginx的日志(错误日志) enter image description here 访问日志 enter image description here

gunicorn command:

gunicorn --bind 0.0.0.0:8000 rest_project.wsgi:application

0 个答案:

没有答案