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
feita há 3 meses136 visualizações
Sem respostas

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas