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

Hello members,

In the DNS records of my DigitalOcean Droplet, I have created two “A” record of my domain with hostname “www” www.HardwareMana.community & Blank HardwareMana.community, which are pointed towards the Cloud server at DigitalOcean. Now both “A” records are having the same IP address but only the blank one is loading while the one with hostname “www” is showing a blank page.

Kindly suggest correct DNS settings, thanks!!

2 Likes

Try this:

Type Hostname Value
A hardwaremana.community 157.245.106.210
CNAME www.hardwaremana.community hardwaremana.community.
CNAME *hardwaremana.community hardwaremana.community.
2 Likes



Done but still www.HardwareMana.community is showing a Blank page.
DNS records at DigitalOcean are not registering .(Dot) in the values.
Do I need any settings at Domain registrar also?

1 Like

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.
Thanks!!

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.

4 Likes

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

check this out.

2 Likes

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
3 Likes

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.

3 Likes

You can’t publish under two URLs.

Pick one, redirect the other.

2 Likes

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.

3 Likes

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 157.245.106.210
CNAME *.hardwaremana.community 157.245.106.210

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.

2 Likes

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 157.245.106.210
A hardwaremana.community 157.245.106.210
CNAME *.hardwaremana.community 157.245.106.210

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