sudo nano /etc/hosts
# add this, or however you want to call it
127.0.0.1 vite-app.test
ngrok http http://vite-app.test
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm noticing an issue: I cannot convince Vite to cooperate with ngrok.
If I just run everything Vite runs in http so I get errors like the following in the web console: https://123.ngrok.com was not allowed to run insecure content from http://[::1]:5173/@vite/client.
If I try to run ngrok through http instead with --scheme=http, ngrok always redirects me to https and as such nothing is shown (to be precise the ngrok ERR_NGROK_3200 page is shown, as nothing is bound to https).
If I add <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"> in my layouts, I get errors like the following in the web console: Failed to load resource: An SSL error has occurred and a secure connection to the server cannot be made. https://[::1]:5173/@vite/client
I feel like I am jumping through many hoops for something that should (and probably is) much more simpler... What am I missing?!
Please or to participate in this conversation.