Problem with fastcgi buffering in App platform.

This issue bothered me for a couple of frustrating hours. I have a Laravel setup on the App platform, using my own container images, but all fairly standard and similar to this DO tutorial in terms of containers.

So I basically have an nginx container talking to a php-fpm container on port 9000. This all works fine in docker-compose, but not on App platform.

The problem was that for longer outputs, especially json, the response just ‘froze’ after about 1500bytes. This made me think it was a buffering issue.

While debugging I connected to the php-fpm server directly using this guide. This worked fine, for outputs of any size.

In the end I found out that there is a nginx directive to disable fastcgi buffering, which resolved the issue.

fastcgi_buffering off;

However I don’t understand why this problem started, and I don’t know whether disabling this buffering may have other (performance?) drawbacks.


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!