代码之家  ›  专栏  ›  技术社区  ›  aspirinemaga

如何在安全网站上发现不可见的混合内容问题?

  •  1
  • aspirinemaga  · 技术社区  · 6 年前

    我部署了一个基本的 PWA 应用于 NGINX CLI . 而不是使用 history Vue路由器的模式, hash 选择模式。

    虽然网站是安全的:

    enter image description here

    我有以下错误,不知道我能做些什么。有人可能已经犯了这样的错误吗?:

    Mixed Content: The page at 'https://example.com/service-worker.js' was loaded over HTTPS, but requested an insecure resource 'http://example.com/'. This request has been blocked; the content must be served over HTTPS.
    Fetch API cannot load https://example.com/index.html. Redirect failed.
    service-worker.js:1 Uncaught (in promise) TypeError: Failed to fetch
    

    ===已更新====

    下面的几行会破坏HTTPS吗?:

    enter image description here

    ===已更新====

    1 回复  |  直到 6 年前
        1
  •  2
  •   khofaai    6 年前

    你不能只是从 no secure 指向的url secure 一个。您可以查看此mozilla文档以了解更多信息:
    https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content/How_to_fix_website_with_mixed_content .