R
Railway3mo ago
Nahasco

Django Allowed Hosts Error "Invalid HTTP_HOST header: '0.0.0.0:8000'"

I am getting this error sent to my admin email from the application I deployed on railway.app
Invalid HTTP_HOST header: '0.0.0.0:8000'. You may need to add '0.0.0.0' to ALLOWED_HOSTS
Invalid HTTP_HOST header: '0.0.0.0:8000'. You may need to add '0.0.0.0' to ALLOWED_HOSTS
and
Invalid HTTP_HOST header: '35.197.110.103:7010'. You may need to add '35.197.110.103' to ALLOWED_HOSTS
Invalid HTTP_HOST header: '35.197.110.103:7010'. You may need to add '35.197.110.103' to ALLOWED_HOSTS
The application works fine with no issues but I randomly get these errors sent to the admin email. Do I add these to addresses to my allowed hosts? Are these the addresses associated with my railway project?
7 Replies
Percy
Percy3mo ago
Project ID: 643c9962-5fa0-449c-82e0-67b30f66c552
Nahasco
Nahasco3mo ago
643c9962-5fa0-449c-82e0-67b30f66c552
Brody
Brody3mo ago
you can add these to the allowed hosts
Nahasco
Nahasco3mo ago
Thanks for the quick response. Can you explain what these or and where are they coming from? Especially the ip address, how would i know that without getting the error?
Brody
Brody3mo ago
the first one is local address and the second one is a gcp ip
Nahasco
Nahasco3mo ago
I guess the gcp ip is different for different projects or deployments, if thats the case how would I find the gcp ip of my deployment?
Brody
Brody3mo ago
that wouldn't be necessary, ideally you would turn off these kinds of notifications