[Vuejs]-Vite Production Error – Mixed Content The page at 'https://example.herokuapp.com/' was loaded over HTTPS, but requested an insecure stylesheet

0πŸ‘

S1. Open .htaccess file and add the following line Header always set Content-Security-Policy "upgrade-insecure-requests;"

S2. remove these lines from your htaccess:

RewriteCond %{SERVER_PORT} ^443$
RewriteRule (.*) http://www.example.com/$1 

Please note that 443 port number is used for HTTPS requests.

0πŸ‘

As you are deploying to Heroku, you are probably behind a proxy.
So you have to set Trusted Proxies. (See doc at https://laravel.com/docs/9.x/requests#configuring-trusted-proxies)

You can open the file /app/Http/Middleware/TrustProxies.php and then enable all ip if you don’t know the proxy IP.

/**
* The trusted proxies for this application.
*
* @var array<int, string>|string|null
*/
protected $proxies = '*';

Leave a comment