"Invalid Host header" Error

Posted August 29, 2020 9.3k views
NetworkingLet's EncryptDigitalOcean Accounts
  1. I have deployed my server on ubunto-20x, tested it with IP address and was working fine.

  2. Then i added the domain name (from namecheap), added ns1, ns2, to namecheap NameSpaces, and setup-ed the @ and www referring to the droplet in my domain

  3. setup-ed ufw to allow only http and https access

  4. Then setup-ed SSL certificate using Let’s Encrypt and Certbot.

Now i am getting “Invalid Host header” on result when i use, Although it is working when i use (my droplet IP)

what could be wrong ?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi there @ahmedmohsenafifi,

This could be due to a host check on your application level. What is the framework that you are using?

You might have to add your new domain name to the allowed hosts or disable the host check from your application, but this would depend on the framework.