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
posta 3 mesi fa136 visualizzazioni
Nessuna risposta

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande