wending's avatar

There is no automatic follow protocol, http is used under https, how to solve it #602

There is no automatic follow protocol, http is used under https, how to solve it

A new laravel project, using jetstream, was finally deployed on a fully connected https website, causing problems caused by referencing http://

0 likes
8 replies
wending's avatar
        @routes
        @vite(['resources/js/app.js', "resources/js/Pages/{$page['component']}.vue"])
        @inertiaHead

How does this part generate the URL? Why does it not automatically follow the protocol?

gych's avatar

In your ENV file, does the APP_URL start with https:// ?

wending's avatar

@gych When I click to log in and register, I will see an error.

gych's avatar

@wending So after you've modified the APP_URL to use https:// try to run php artisan config:clear

wending's avatar

@gych in the bootstrap/app.php

need add *.

       // Prevent ziggy route() from being unable to generate https problems, at: '*',
        $middleware->trustProxies(
            at: '*',
            headers: Request::HEADER_X_FORWARDED_FOR |
                Request::HEADER_X_FORWARDED_HOST |
                Request::HEADER_X_FORWARDED_PORT |
                Request::HEADER_X_FORWARDED_PROTO |
                Request::HEADER_X_FORWARDED_AWS_ELB
        );

thankyou

1 like

Please or to participate in this conversation.