# \[DigitalOcean\] A 记录中包含“www”的主机名显示空白页面

**URL:** <https://meta.discourse.org/t/digitalocean-hostname-having-www-in-a-records-showing-blank-page/128227>\
**Category:** Self-hosting\
**Tags:** hosting\
**Created:** [2019年九月11日 03:45 UTC](https://meta.discourse.org/t/digitalocean-hostname-having-www-in-a-records-showing-blank-page/128227 "2019-09-11T03:45:59Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![xrav3nz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/xrav3nz/32/76894_2.png) [@xrav3nz](https://meta.discourse.org/u/xrav3nz)\
**Post date:** [2019年九月16日 14:40 UTC](https://meta.discourse.org/t/digitalocean-hostname-having-www-in-a-records-showing-blank-page/128227/13 "2019-09-16T14:40:36Z")

</div>

我认为您的 DNS 配置正确。

如果您访问 `www.hardwaremana.community` 并打开控制台，**会看到关于 [内容安全策略 (CSP)](https://meta.discourse.org/t/mitigate-xss-attacks-with-content-security-policy/104243) 的错误**：

`拒绝加载脚本 'http://www.hardwaremana.community/...'，因为它违反了以下内容安全策略指令："script-src 'unsafe-eval' 'report-sample' http://hardwaremana.community/... ..."。`

请注意，只有非 `www` 主机被列入白名单，因为：

> [@Systmyz](#):
>
> **Discourse 的主机名** 为 `hardwaremana.community`

Discourse 会根据此值自动设置您的 CSP。因此，建议您选择一个（`www` 或非 `www`），并为另一个设置重定向。

---

_[View the full topic](https://meta.discourse.org/t/digitalocean-hostname-having-www-in-a-records-showing-blank-page/128227)._
