0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Django + nginx + gunicorn + EC2(AWS)でアクセス系のエラー

Last updated at Posted at 2023-01-09

◆前提

.bash_profileやNginxの設定ファイルを変更時は確かに反映させるように
gunicornも再起動させること

◆主な登場人物
セキュリティグループ(EC2)
.bash_profile
nginx.conf
settings.py

◆諸々エラー

◎502 Bad Gateway, CONNECTION_REFUSED
→EC2のセキュリティ設定がおかしい(ポートが開いていないとか)
→nginxで正しいportをlistenしていない
例)EC2でポート80番を許可しているが、nginxは10080番で待ち受けている

◎400 Bad Request
ALLOWED_HOSTSが誤っている
※os.environ.get('ALLOWED_HOSTS')は上手くいかないみたい

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?