djangoアプリをnginxとgunicornを使いデプロイしたいが、エラー「502 Bad Gateway」が出て進めません。
参考サイトを元にAWSのEC2にdjangoアプリをデプロイしています。
今回nginxとgunicornを使いデプロイしようとしており、参考サイトの最後でブラウザに接続したのですが、「502 Bad Gateway」が出て上手くいかず困っています。
環境は参考サイトとほぼ同じで、DBにMYSQLを使っているだけの違いです。
nginxのエラーログ
2021/04/10 01:56:45 [emerg] 44550#44550: bind() to 0.0.0.0:80 failed (98: Address already in use)
2021/04/10 01:56:45 [emerg] 44550#44550: bind() to [::]:80 failed (98: Address already in use)
2021/04/10 01:56:45 [emerg] 44550#44550: still could not bind()
2021/04/10 02:00:59 [crit] 44395#44395: *4 connect() to unix:/home/ubuntu/movieist/container/django_app/django_app.sock failed (2: No such file or directory) while connecting to upstream, client: 114.151.165.1, server: 54.168.166.0, request: "GET / HTTP/1.1", upstream: "http://unix:/home/ubuntu/movieist/container/django_app/django_app.sock:/", host: "54.168.166.0"
2021/04/10 02:01:13 [crit] 44395#44395: *4 connect() to unix:/home/ubuntu/movieist/container/django_app/django_app.sock failed (2: No such file or directory) while connecting to upstream, client: 114.151.165.1, server: 54.168.166.0, request: "GET / HTTP/1.1", upstream: "http://unix:/home/ubuntu/movieist/container/django_app/django_app.sock:/", host: "54.168.166.0"
2021/04/10 02:01:14 [crit] 44395#44395: *4 connect() to unix:/home/ubuntu/movieist/container/django_app/django_app.sock failed (2: No such file or directory) while connecting to upstream, client: 114.151.165.1, server: 54.168.166.0, request: "GET / HTTP/1.1", upstream: "http://unix:/home/ubuntu/movieist/container/django_app/django_app.sock:/", host: "54.168.166.0"
2021/04/10 02:02:43 [crit] 44395#44395: *8 connect() to unix:/home/ubuntu/movieist/container/django_app/django_app.sock failed (2: No such file or directory) while connecting to upstream, client: 114.151.165.1, server: 54.168.166.0, request: "GET / HTTP/1.1", upstream: "http://unix:/home/ubuntu/movieist/container/django_app/django_app.sock:/", host: "54.168.166.0"
2021/04/10 02:02:45 [crit] 44395#44395: *8 connect() to unix:/home/ubuntu/movieist/container/django_app/django_app.sock failed (2: No such file or directory) while connecting to upstream, client: 114.151.165.1, server: 54.168.166.0, request: "GET / HTTP/1.1", upstream: "http://unix:/home/ubuntu/movieist/container/django_app/django_app.sock:/", host: "54.168.166.0"
2021/04/10 02:02:48 [crit] 44395#44395: *8 connect() to unix:/home/ubuntu/movieist/container/django_app/django_app.sock failed (2: No such file or directory) while connecting to upstream, client: 114.151.165.1, server: 54.168.166.0, request: "GET / HTTP/1.1", upstream: "http://unix:/home/ubuntu/movieist/container/django_app/django_app.sock:/", host: "54.168.166.0"
2021/04/10 02:02:54 [crit] 44395#44395: *8 connect() to unix:/home/ubuntu/movieist/container/django_app/django_app.sock failed (2: No such file or directory) while connecting to upstream, client: 114.151.165.1, server: 54.168.166.0, request: "GET / HTTP/1.1", upstream: "http://unix:/home/ubuntu/movieist/container/django_app/django_app.sock:/", host: "54.168.166.0"
2021/04/10 02:06:57 [crit] 44395#44395: *13 connect() to unix:/home/ubuntu/movieist/container/django_app/django_app.sock failed (2: No such file or directory) while connecting to upstream, client: 46.191.234.21, server: 54.168.166.0, request: "GET / HTTP/1.1", upstream: "http://unix:/home/ubuntu/movieist/container/django_app/django_app.sock:/", host: "54.168.166.0:80"
2021/04/10 02:08:20 [crit] 44395#44395: *15 connect() to unix:/home/ubuntu/movieist/container/django_app/django_app.sock failed (2: No such file or directory) while connecting to upstream, client: 128.199.228.238, server: 54.168.166.0, request: "GET / HTTP/1.1", upstream: "http://unix:/home/ubuntu/movieist/container/django_app/django_app.sock:/", host: "54.168.166.0:80"
エラーログについて調べましたが理解ができず行き詰まってしまいました。
至らない点が多々あるかと思いますが、よろしくお願いします。
0