How to enforce ->viteTheme to use https?
I've created a custom theme using
->viteTheme
method. However, when I apply the theme in the production environment, I encounter an issue where the asset imports are using HTTP instead of HTTPS, leading to mixed content errors.
I came across a suggestion to use secure_assets, but it seems incompatible with ->viteTheme
. This problem is specific to the Vite theme; other assets are correctly served over HTTPS when I use the following configuration:
Despite this, the assets from the Vite theme continue to be imported via HTTP. How can I ensure that Vite theme assets are served over HTTPS in a production environment?6 Replies
Make sure APP_URL in your env has https
Or force the schema in a service provider.
Do you have an asset URL set?
There isn't, should there be?
I will try thanks
URL::forceScheme('https')
you can also try ASSET_URL='https://xx'
in the .env fileworked for me thanks