Health check invalid HTTP_HOST header: 'localhost:10000'

Hello!

I’m getting a Invalid HTTP_HOST header: 'localhost:10000' in my Django app during the health check during deployment. I have this in my settings file as per the instructions:

RENDER_EXTERNAL_HOSTNAME = env("RENDER_EXTERNAL_HOSTNAME", default=None)
if RENDER_EXTERNAL_HOSTNAME:
    ALLOWED_HOSTS.append(RENDER_EXTERNAL_HOSTNAME)

It works fine and boots up and everything is OK, but I do get a Sentry error on every deploy. Thoughts as to what could be causing this?

Hi Harry,

It looks like that’s coming from our port-detector process which tries to automatically determine what port to open for your service. If you add ALLOWED_HOSTS.append('localhost') below the code you already have now, that will get rid of your Sentry error!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.