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

stacker's avatar

Laravel CORS not working for POST request when using Docker and Nginx

I finally made it work, no more CORS error, but that's because I manually set Nginx to reply to POST requests with the Access-Control-Allow-Origin.

This is the full description of my issue on Stack Overflow, please help me find out what causes the issue: https://stackoverflow.com/questions/69135473/laravel-cors-not-working-when-using-docker-and-nginx

I also opened an issue on the laravel-cors repo in GitHub. It does seem to be an issue because Laravel sends the correct Access-Control-Allow-Origin for OPTIONS and GET but not for POST request

0 likes
0 replies

Please or to participate in this conversation.