Развертывание django на Elastic Beanstalk в производственном режиме с помощью WhiteNoise
Я пытаюсь развернуть мое приложение django в состоянии debug=false с помощью whitenoise, но получаю ошибку 502 Bad Gateway. Я не понимаю, что я делаю неправильно, поэтому мне нужна помощь в этом вопросе. В журнале есть сообщение об этой ошибке:
/var/log/nginx/error.log
2021/09/13 15:06:13 [error] 2770#2770: *15675 open() "/var/app/current/static/js/bootstrap.bundle.min.js.map" failed (2: No such file or directory), client: 172.31.7.18, server: , request: "GET /static/js/bootstrap.bundle.min.js.map HTTP/1.1", host: "www.gamehunterz.com". 2021/09/13 15:06:13 [error] 2770#2770: *15675 open() "/var/app/current/static/css/bootstrap.min.css.map" failed (2: No such file or directory), client: 172.31.7.18, server: , request: "GET /static/css/bootstrap.min.css.map HTTP/1.1", host: "www.gamehunterz.com". 2021/09/13 16:02:23 [error] 4831#4831: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.37.154, server: , request: "GET /28105/albedo-and-cast-of-the-seven-godsends HTTP/1.1", upstream: "http://127.0.0.1:8000/28105/albedo-and-cast-of-the-seven-godsends", host: "www.gamehunterz.com". 2021/09/13 16:03:22 [error] 4831#4831: *18 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.7.18, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "www.gamehunterz.com". 2021/09/13 16:03:22 [error] 4831#4831: *18 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.7.18, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:8000/favicon.ico", host: "www.gamehunterz.com", referrer: "https://www.gamehunterz.com/"
Мой файл django.config:
option_settings:
aws:elasticbeanstalk:container:python:
WSGIPath: newgamehunterz.wsgi:application
aws:elasticbeanstalk:environment:proxy:staticfiles:
/static: static
Мой файл настроек выглядит следующим образом:
Установка gunicorn решила проблему