ELB HTTPS setup for Django App

0

Hello. I am using AWS Amplify (HTTPS) to host my React app. It cannot communicate with my EB instance (Django Rest Framework app) since it uses HTTP. I made a subdomain and have got a SSL certificate which I imported into AWS and added to an ELB (Classic) on my instance, which listens on 443 (HTTPS) and has instance port as 80 (HTTP). The EB instance health is now on Severe and the logs say:

 django.core.exceptions.DisallowedHost: Invalid HTTP_HOST header: '172.31.3.66'. You may need to add '172.31.3.66' to ALLOWED_HOSTS.
Invalid HTTP_HOST header: '172.31.3.66'. You may need to add '172.31.3.66' to ALLOWED_HOSTS.

I've verified that the subdomain infact connected to the EB instance and it worked fine using HTTP. After I changed the instance listener protocol and port to HTTP and 80, it stopped working altogether. Please let me know if you have any ideas on how this can be setup correctly.

Rohit
asked 3 months ago133 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions