Skip to content
Discussion options

You must be logged in to vote

Could you please confirm if you're accessing the application through Ngrok? This often causes HTTPS detection issues and leads to mixed-content errors.

In the meantime, you can fix the issue by adding the following code inside App\Providers\AppServiceProvider in the register() method:

if (
    (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] === 'on' || $_SERVER['HTTPS'] == 1))
    || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https')
) {
    $this->app['request']->server->set('HTTPS', true);
}

This forces Laravel to properly detect HTTPS when running behind Ngrok or a proxy.
After adding it, please clear the caches and reload the application.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by VikassWebkul214254
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2371 on November 24, 2025 13:04.