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
已提問 3 個月前檢視次數 136 次
沒有答案

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南