-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
I have set up my Laravel API with Docker(version: 26.1.1), Nginx(image: nginx:stable-alpine), and PHP(image: php:7.4-fpm-alpine) on Debian vps.
For a few days I'm struggling with a strange problem: The result I receive for my API request does not only include the valid response, but also the parameters that I send along with the post request;
Request:
{ "email": "[email protected]", "password": "xxxxxxx" }
Response:
{ "email": "[email protected]", "password": "xxxxxxx" }{ "token": "xxxxxxxxxxxxxxxxxxxxxxxxxx", "type": "xxxxxxxx" }
This response does not come with a content-type: application/json but as text/html. It seems like the post request body is prepended to the response data of my API. This results in a JSON parse error on my client.
After restarting the nginx server, the problem disappeared temporarily and then started again. I checked in both Nginx and laravel logs, there would be no error.