s3nior's avatar

ngrok: vue frontend / laravel backend CORS Error

Hi, im trying to create a zoom clone with vue and laravel.

To test my client on mobile phones im using ngrok. Now the problem is, when im trying to login over ngrok to my app. Im getting a CORS error.

Access to XMLHttpRequest at 'http://my-service.test/api/login' from origin 'http://xxxx88822.ngrok.io' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource

On my local machine it is working. I´m using Laravel valet

Does anybody have a clue how to solve this? Would be great

0 likes
3 replies
s3nior's avatar

Tank you, i already have CORS activated. My app is already live and working, but now im trying to add a new feature.

Another problem with ngrok is, that the frontend cannot connect to the socket.

hrsa's avatar

I fixed this issue by adding this flag:

--host-header=rewrite
1 like

Please or to participate in this conversation.