nginx - AMP HTML amp-ads - 阻止的帧、协议、域和端口必须匹配
问题描述
我正在尝试解决一个错误,该错误阻止我在我构建并托管在 nginx 服务器上的 amp-html 网站上显示 google-adsense 广告。我在 Stack Overflow、 Google Adsense和Amp By Example文档中搜索并阅读了很多类似的问题。
根据Google 的说明,我放置了一个 amp-ad 。页面本身可以正确加载,但广告应该是空白。在控制台中,我收到此错误(两次):
Blocked a frame with origin "https://d-1234567890.ampproject.net" from accessing a frame with origin "https://example.com". Protocols, domains, and ports must match.
我最近将 Nameservers 移到了一个新服务器上,该服务器现在支持https
而不是http
. 该网站似乎仍在 Adsense 中进行验证,但它是否试图通过错误的协议发送广告?
协议必须匹配——似乎是这样,因为两个站点都是 https。
域和端口必须匹配——好的,但是如何验证这些呢?
除此之外,除了盲目关闭安全措施外,我不太确定如何解决问题。我应该查看我的标题(X-Frame-Options
,X-Content-Type-Options
等)吗?还是我的Content-Security-Policy
头?还是 Google Adsense 还在使用旧的 http 协议?
FWIW,我还在控制台中收到这些(相关)警告:
[Warning] The resource https://3p.ampproject.net/234567890/f.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it wasn't preloaded for nothing.
[Warning] The resource https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it wasn't preloaded for nothing.
预先感谢您的帮助。
解决方案
推荐阅读
- angular - Express 不提供已编译的 Angular 文件
- php - docker php-fpm:通过端口 9000 连接服务失败
- r - 更改布局 DiagrammeR
- greatest-common-divisor - 用 Dafny 证明 gcd 算法
- firebase - 在 Firebase 存储规则中使用用户声明
- android - CoordinatorLayout 中 RecyclerView 的奇怪行为
- php - 我无法通过 PHP 使用我的 powershell 脚本制作 word 文件
- r - 对长度不同的序列进行迭代的分组数学运算
- java - 与 JAX-RS 一起使用时布尔属性的 Lombok 问题
- android - 如何将授权承载标头添加到 webview android?