Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

MMillie's avatar

Mixed Content Error with PHP Laravel and Laravel Orchid App

We are encountering an error using the frameworks Laravel and Laravel Orchid. We are getting the error: Mixed Content: The page at 'website/admin/login' was loaded over HTTPS, but requested an insecure resource 'website/admin/dashboard'. This request has been blocked; the content must be served over HTTPS.

We have tried a number of fixes including url->forcescheme('https') in Appserviceprovider.php. We have also tried creating a middleware that redirects to https and also changing ASSET_URL in .ENV. None of these fixes have worked for us to solve the entire problem. They worked initially for those errors related to the favicon not loading as it included mixed content but one error is still persisting that is causing the login page to hang.

We are using AWS EC2, S3 and using a Fargate server setup. This error does not persist with the same code base on cpanel.

0 likes
3 replies
jlrdw's avatar

Check for a hard coded url somewhere.

MMillie's avatar

There is none. Only using proper routing

MMillie's avatar
MMillie
OP
Best Answer
Level 1

This was fixed by editing AppServiceProvider.php and adding $this->app['request']->server->set('HTTPS','on'); in the boot method.

Please or to participate in this conversation.