各位成员,
在我的 DigitalOcean Droplet 的 DNS 记录中,我为域名创建了两条 "A" 记录:一条主机名为 "www" (www.HardwareMana.community),另一条为 空白 (HardwareMana.community),它们都指向 DigitalOcean 的云服务器。目前这两条 "A" 记录具有相同的 IP 地址,但只有空白记录能正常加载,而主机名为 "www" 的记录显示为空白页面。
请提供正确的 DNS 设置建议,谢谢!
各位成员,
在我的 DigitalOcean Droplet 的 DNS 记录中,我为域名创建了两条 "A" 记录:一条主机名为 "www" (www.HardwareMana.community),另一条为 空白 (HardwareMana.community),它们都指向 DigitalOcean 的云服务器。目前这两条 "A" 记录具有相同的 IP 地址,但只有空白记录能正常加载,而主机名为 "www" 的记录显示为空白页面。
请提供正确的 DNS 设置建议,谢谢!
Try this:
| Type | Hostname | Value |
|---|---|---|
| A | hardwaremana.community | 157.245.106.210 |
| CNAME | www.hardwaremana.community | hardwaremana.community. |
| CNAME | *hardwaremana.community | hardwaremana.community. |
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!!
No, that hostname should be correct.
Hostname for your Discourse? [discourse.example.com]
Don’t use capital letters in your hostnames. Ever.
correction, I am using hardwaremana.community only. So please advise accordingly, Thanks 
check this out.
Your content security policy only allows scripts loaded over HTTP.
Did you enable the force_https site setting?
No, please guide me more about that. thanks @RGJ
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
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 | 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!!
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 | 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.
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.
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.
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).