Techiio-author
Started by David HarrisonOct 5, 2021

Open
Is it safe to add EC2 public IP to ALLOWED_HOSTS in Django + Elastic Beanstalk?

2 VIEWES 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 2 VIEWES SHARE

I have deployed a Django app as a single instance Elastic Beanstalk environment without Elastic Load Balancer. The setup is Nginx + Gunicorn + Django. SSL is enabled for Nginx server.

I have added the host assigned by elastic beanstalk (....elasticbeanstalk.com) to ALLOWED_HOSTS in the settings file, and the app is accessible.

But some operations are failing and there are a lot of Invalid HTTP_HOST_HEADER errors in the log file. The header in majority of these errors are the Public IP of the EC2 instance.

Is it safe to add the EC2 Public IP to the allowed hosts ?

0 Replies

You must be Logged in to reply
Techiio-logo

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Developed and maintained by Wikiance
Developed and maintained by Wikiance