Laravel Vite: Assets blocked/Mixed Content issues in production environment #44258
Unanswered
bblumenfelder
asked this question in
Q&A
Replies: 3 comments
-
@bblumenfelder have you figured out anything? |
Beta Was this translation helpful? Give feedback.
0 replies
-
I'm also running into this issue. If anyone familiar with Laravel's implementation of vite wants to point me in the right direction, I'm happy to fix the issue and send a pull request. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Also facing this issue :( |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm hosting my App on an EC2-instance behind an Elastic Load Balancer which manages my SSL-Certificate. On this EC2-Instance my nginx-configuration is redirecting all http-Requests to https.
I recently switched to Vite which caused me a lot of trouble. When I push my app to the server after calling
npm run build
my assets are blocked. In the browser console I get:My Setup:
vite.config.js
Setting "https: true" in the server-block didn't help me.
.env
In my blade template I'm using the Vite-directive:
I tried the following solutions:
$proxies = '*'
in TrustProxies.php, which doesn't have any effect.URL::forceScheme('https');
in AppServiceProvider.php, which will load the assets but lead to a lot of other issues.Somehow the @vite-directive is not resolving my assets as secure assets. With Laravel Mix I could just call
secure_asset
.How can I fix this?
Beta Was this translation helpful? Give feedback.
All reactions