[DigitalOcean] hostname having "www" in A records showing blank page

One more thing, I have discovered that the settings in my Discourse installation at DigitalOcean cloud server having Hostname for Discourse is Hardwaremana.community . Is this can be the problem of my www.HardwareMana.community domain? Kindly assist.

1 Like

No, that hostname should be correct.

Hostname for your Discourse? [discourse.example.com]

1 Like

Don’t use capital letters in your hostnames. Ever.


correction, I am using hardwaremana.community only. So please advise accordingly, Thanks :slightly_smiling_face:

check this out.


Your content security policy only allows scripts loaded over HTTP.
Did you enable the force_https site setting?

1 Like

No, please guide me more about that. thanks @RGJ

1 Like
ssh root@your.server.ip
cd /var/discourse
./launcher enter app
rails c
SiteSetting.force_https = true

Done with above settings and now it is not connecting with Cloud server anymore. So after making it false SiteSetting.force_https = false, operations are same as before
https://www.hardwaremana.community this is showing unable to connect
www.Hardwaremana.community, this is showing a Blank Page but not launching Discourse installation.
hardwaremana.community launching Discourse as normal

1 Like

I believe your DNS is set up correctly.

If you go to www.hardwaremana.community and open the console, there are errors about Content Security Policy (CSP):

Refused to load the script 'http://www.hardwaremana.community/...' because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'report-sample' http://hardwaremana.community/... ...".

Note that only the non-www host is whitelisted, because:

Discourse automatically sets your CSP based on this value. So I recommend picking one (www vs non-www) and setting up a redirect for the other.


You can’t publish under two URLs.

Pick one, redirect the other.


Thanks for pointing out the errors. Let me rebuild the Discourse setup with new values as www.hardwaremana.community as my new Hostname for Discourse. Will do further redirections accordingly.


I have changed Hostname for Discourse to www.hardwaremana.community and now the issue has become vice-versa. These are the DNS records, I am using:

Type Hostname Value
A www.hardwaremana.community
CNAME *.hardwaremana.community

While looking at the web console, there are errors about Content Security Policy (CSP) at domain hardwaremana.community, now how to correct these script errors. Kindly guide!!

1 Like

Add another A record with hostname hardwaremana.community
this worked for my D/O instance.


Now having these values in my DNS records of cloud server at DigitalOcean but still hardwaremana.community is not launching discourse and showing script errors in the console.

Type Hostname Value
A www.hardwaremana.community
A hardwaremana.community
CNAME *.hardwaremana.community

https://www.hardwaremana.community this is showing unable to connect
hardwaremana.community this is showing Blank Page with script errors
www.Hardwaremana.community launching Discourse as normal
Kindly suggest, some solution please.

1 Like

Do I need to do some extra domain settings in Discourse config file (app.yml).
Any expert here, kindly guide or share resources to do correct modification in app.yml, so that I can resolve my non-www domain issue.

I just ran a SSL Lookup & Reporting tool and it reports you have no SSL certificate.

SSL Lookup & Reporting Tool

The SSL examination report looks at the SSL certificate on a website and provides SSL validation information. The report will check for hostname mismatches between your domain and what is on the certificate, as well as whether the certificate is expired, revoked, or trusted.

Sorry, there was a problem.

  • No certificate found.

Even Firefox shows all 3 domains are not secure (https, www, and non-www).
Do you have a SSL certificate for your domains? A redirect to/from https would most likely return errors when there is no SSL certificate.

Checked all 3:
https cannot establish a connection;
http (hardwaremana.community) is returning a blank page; but
www does load Discourse (black & crossed out padlock).

1 Like

Thanks a lot for the correction @JimPas. I have configured Setting up HTTPS support with Let's Encrypt. Now www.hardwaremana.community is showing green padlock but hardwaremana.community is showing Welcome to nginx!. What went wrong? and kindly share any resources to configure it. Thanks!!

1 Like

Pointing a DNS entry at an IP isn’t a redirect. Nginx doesn’t have an entry for the second hostname, it’s not going to magically resolve.

You can either go down the route of manually adding redirects to your config, or using an external service.


Thanks for the suggestion.

Are you talking to modify app.yml or somewhere else at Host side (DigitalOcean)?