Daniel K
Daniel K

Reputation: 53

Configure Apache/Django on elastic beanstalk to address INVALID_HOST errors

Background:

Current setup is

ALLOWED_HOST has been set in Django so that it includes

Issues:

Two questions:

Will appreciate any help

Thank you!

Upvotes: 1

Views: 158

Answers (1)

HenryM
HenryM

Reputation: 5793

These are probably the elastic beanstalk healthcheck calls. These come from an IP address.

Try adding to settings.py

from socket import gethostname, gethostbyname  # For AWS Healthchecker
HOST_NAME = gethostname()
HOST_IP = gethostbyname(HOST_NAME)
ALLOWED_HOSTS [ 
    ...
    HOME_NAME, HOME_IP,
    ...
]

Upvotes: 0

Related Questions