Linux Administrator - Disable Output Buffering with PHP and NGINX

Linux Administrator

Privacy Policy

RSS Feed


Acoustic Guitar Tips
Anna Kendrick
Beekeeping Tips
BLISS
Catherine Zeta Jones
My View On Things
Cheap Auto Insurance
Cheap Places to Live
Delta Shaper
Easy Wood Projects
Free Sheet Music
Funny Clean Jokes
Healthy Carbs
Heidi Klum
Improve Your Credit
Ivory Tower Group
Keke Palmer
Linda Ronstadt
Linux Administrator
Money Spigot
Nicole Kidman
Planet Cabinet
Quality Dating Advice
Rustic Cabinets
Sacramento Hiking
Sandra Bullock
Spintax Tool
The Actress
Who Are The Beatles


Disable Output Buffering with PHP and NGINX

Disable Output Buffering with PHP and NGINX

A client wanted to be able to display a line at a time in a user's web browser, not wait for the entire result and display everything at once. This worked fine in Apache, but when he upgraded to NGINX, it stopped working. The solution was to change the default NGINX configuration to not buffer output. He also had to make a few changes to his script.

First things first. The NGINX configuration needed these three lines added to the http section:

fastcgi_keep_conn on;
proxy_buffering off;
gzip off;
Then, his script needed this line added to the beginning:

header('Content-Encoding: none;');

That's it.


Return To Main Page