【发布时间】:2021-09-11 13:23:18
【问题描述】:
我已将我的 laravel 应用程序部署到 heroku。我在下面有这个文件作为我的 frontend.blade.php 但不知何故 heroku 把这个错误消息扔给了 chrome 开发者控制台。
错误:
geeksolution.herokuapp.com/:18 混合内容:“https://geeksolution.herokuapp.com/”页面通过 HTTPS 加载,但请求的样式表不安全“http://geeksolution.herokuapp.com/”前端/css/main.css'。此请求已被阻止;内容必须通过 HTTPS 提供。 geeksolution.herokuapp.com/:22 混合内容:“https://geeksolution.herokuapp.com/”页面通过 HTTPS 加载,但请求了不安全的样式表“http://geeksolution.herokuapp.com/frontend/css” /app.minify.css'。此请求已被阻止;内容必须通过 HTTPS 提供。 geeksolution.herokuapp.com/:1 混合内容:“https://geeksolution.herokuapp.com/”的页面是通过 HTTPS 加载的,但请求的脚本不安全“http://geeksolution.herokuapp.com/frontend/js /app.js'。此请求已被阻止;内容必须通过 HTTPS 提供。 geeksolution.herokuapp.com/:1 混合内容:“https://geeksolution.herokuapp.com/”的页面是通过 HTTPS 加载的,但请求的网站图标不安全“http://geeksolution.herokuapp.com/frontend/images /content/favicon.png'。此请求已被阻止;内容必须通过 HTTPS 提供。 site.webmanifest:1 加载资源失败:服务器响应状态为 404(未找到) site.webmanifest:1 清单:行:1,列:1,语法错误。 geeksolution.herokuapp.com/:1 混合内容:“https://geeksolution.herokuapp.com/”页面通过 HTTPS 加载,但请求的样式表不安全“http://geeksolution.herokuapp.com/frontend/css /main.css'。此请求已被阻止;内容必须通过 HTTPS 提供。 geeksolution.herokuapp.com/:1 混合内容:“https://geeksolution.herokuapp.com/”页面通过 HTTPS 加载,但请求的样式表不安全“http://geeksolution.herokuapp.com/frontend/css /app.minify.css'。此请求已被阻止;内容必须通过 HTTPS 提供。 DevTools 无法加载源地图:无法加载 chrome-extension://fheoggkfdfchfphceeifdbepaooicaho/sourceMap/chrome/iframe_handler.map 的内容:HTTP 错误:状态代码 404,net::ERR_UNKNOWN_URL_SCHEME DevTools 无法加载源地图:无法加载 chrome-extension://fheoggkfdfchfphceeifdbepaooicaho/sourceMap/chrome/content.map 的内容:HTTP 错误:状态代码 404,net::ERR_UNKNOWN_URL_SCHEME site.webmanifest:1 加载资源失败:服务器响应状态为 404(未找到)
前端.blade.php:
<meta charset="utf-8" />
<title>Geek Solution</title>
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta property="og:title" content="" />
<meta property="og:type" content="" />
<meta property="og:url" content="" />
<meta property="og:image" content="" />
<link rel="manifest" href="site.webmanifest" />
<link rel="apple-touch-icon" href="{{ url('/frontend/images/content/favicon.png') }}" />
<!-- Place favicon.ico in the root directory -->
<link rel="stylesheet" href="{{ url('/frontend/css/main.css') }}" />
<link rel="icon" href="{{ url('/frontend/images/content/favicon.png') }}" />
<meta name="theme-color" content="#000" />
<link rel="icon" href="favicon.ico"><link href="{{ url('/frontend/css/app.minify.css') }}" rel="stylesheet"></head>
【问题讨论】:
-
将您的样式表链接替换为安全版本(https 而不是 http) 您无法在所有现代浏览器的 https 页面中加载 http 资源。在 config 或 .env 中更改您的应用程序基本 url
标签: php html css laravel heroku