1

I've deployed my laravel app to heroku. I have this file below as my frontend.blade.php but somehow heroku is throwing me this error message to the chrome developer console.

Error:

geeksolution.herokuapp.com/:18 Mixed Content: The page at 'https://geeksolution.herokuapp.com/' was loaded over HTTPS, but requested an insecure stylesheet 'http://geeksolution.herokuapp.com/frontend/css/main.css'. This request has been blocked; the content must be served over HTTPS. geeksolution.herokuapp.com/:22 Mixed Content: The page at 'https://geeksolution.herokuapp.com/' was loaded over HTTPS, but requested an insecure stylesheet 'http://geeksolution.herokuapp.com/frontend/css/app.minify.css'. This request has been blocked; the content must be served over HTTPS. geeksolution.herokuapp.com/:1 Mixed Content: The page at 'https://geeksolution.herokuapp.com/' was loaded over HTTPS, but requested an insecure script 'http://geeksolution.herokuapp.com/frontend/js/app.js'. This request has been blocked; the content must be served over HTTPS. geeksolution.herokuapp.com/:1 Mixed Content: The page at 'https://geeksolution.herokuapp.com/' was loaded over HTTPS, but requested an insecure favicon 'http://geeksolution.herokuapp.com/frontend/images/content/favicon.png'. This request has been blocked; the content must be served over HTTPS. site.webmanifest:1 Failed to load resource: the server responded with a status of 404 (Not Found) site.webmanifest:1 Manifest: Line: 1, column: 1, Syntax error. geeksolution.herokuapp.com/:1 Mixed Content: The page at 'https://geeksolution.herokuapp.com/' was loaded over HTTPS, but requested an insecure stylesheet 'http://geeksolution.herokuapp.com/frontend/css/main.css'. This request has been blocked; the content must be served over HTTPS. geeksolution.herokuapp.com/:1 Mixed Content: The page at 'https://geeksolution.herokuapp.com/' was loaded over HTTPS, but requested an insecure stylesheet 'http://geeksolution.herokuapp.com/frontend/css/app.minify.css'. This request has been blocked; the content must be served over HTTPS. DevTools failed to load source map: Could not load content for chrome-extension://fheoggkfdfchfphceeifdbepaooicaho/sourceMap/chrome/iframe_handler.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME DevTools failed to load source map: Could not load content for chrome-extension://fheoggkfdfchfphceeifdbepaooicaho/sourceMap/chrome/content.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME site.webmanifest:1 Failed to load resource: the server responded with a status of 404 (Not Found)

frontend.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>


Reza Alf
  • 11
  • 3
  • replace your stylesheet link with secure verison (https instead of http) You can't load http ressources in a https pages with all modern browsers. Change your app base url in config or .env – N69S Jun 29 '21 at 10:29
  • Does this answer your question? [How to force Laravel Project to use HTTPS for all routes?](https://stackoverflow.com/questions/35827062/how-to-force-laravel-project-to-use-https-for-all-routes) – N69S Jun 29 '21 at 10:31

1 Answers1

1

This will be due to a server misconfiguration which has prevented laravel from knowing that your app is running over https.

See Laravel generate secure https URL from route on how you can force secure link generation.

Anywhere you are using the url method should be changed to the secure_url helper method https://laravel.com/docs/8.x/helpers#method-secure-url

DevWithZachary
  • 3,545
  • 11
  • 49
  • 101
  • 1
    you dont have to use `secure_url()`, the `url()` method will use https if the request and your configured base url are in https. there is a downside of using `secure_url()` in your project, maintaining the code in your local environment without setting up proper server can be very painfull – N69S Jun 29 '21 at 10:32