my droplet is from digitalocean.com and domain is from godaddy.com.when website works fine by ip but domain throws "disallowed host" error.

August 23, 2019 159 views
Django DigitalOcean DNS

the error is:
“DisallowedHost at /
Invalid HTTPHOST header: ‘thesis-experiment.com’. You may need to add 'thesis-experiment.com’ to ALLOWEDHOSTS.”
i have had the names of my domain in both nginx site-available and my ALLOWED_HOSTS in settings.py but it still does not work.

i followed this tutorial https://digitalocean.com/community/tutorials/how-to-point-to-digitalocean-nameservers-from-common-domain-registrars

and i have put ns1.digitalocean.com, ns2.digitalocean.com and ns3.digitalocean.com in nameservers of godaddy.com but still no luck.
please help!

1 comment
  • I solved the problem by rebooting the server it seems that restarting nginx was not enough; I used the command “sudo reboot” and the “disallowed host” error went away.

1 Answer

This question was answered by @taheriamirbahador:

I solved the problem by rebooting the server it seems that restarting nginx was not enough; I used the command “sudo reboot” and the “disallowed host” error went away.

View the original comment

Have another answer? Share your knowledge.