Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ValsiS's avatar
Level 10

401 Unauthorized. Only on EC2, not in Homestead

Hello,

I created a Laravel Spark app that works perfect on my homestead, but when i deploy (via envoyer) to EC2 server, when i login, i start to receive 401 Unauthorized. error, not always, not for the same routes. I even receive on settings, or on kiosk page, and there i didn't change nothing, it's exactly like original.

site it's up on a subdomain with https

can someone help me pls ?

i don't think this is the solution https://laracasts.com/discuss/channels/spark/spark-api-returning-401 because i don't have duplicate middleware

0 likes
1 reply
ValsiS's avatar
Level 10

fixed somehow, but only after i setup the SESSION_DRIVER to database, can someone tell me why didn't worked with normal driver (file) ?

Please or to participate in this conversation.