Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8908171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:06:42+00:00 2026-06-15T03:06:42+00:00

I have a comet-driven chat script in my site My Servers configuration is NGINX

  • 0

I have a comet-driven chat script in my site

My Servers configuration is NGINX with PHP-FPM , I also have apache installed on different port.

When I try to run the chat script on Apache and I do flood the buffer ( my output buffering size is 1 KB) when I flood it with 1024 character, it flushes automatically That’s in apache.

But in nginx it doesn’t.

My code is very similar to this

<?php

// this is to fill the buffer and start output; and it works on apache normally
echo str_repeat(" ",1024); 


while($condition){

  // Some code here...
  $messages = getMessagesFromDatabase();

 if($messages){
  echo "output";   // output works on apache but not nginx
  flush();
  ob_flush();
 }

 usleep(500000); // 0.5 Second

}


?>

in my nginx configuration i turned gzip off, proxy_buffering off,

is there a way to avoid buffering in nginx, I searched a lot here in stackoverflow but I couldn’t reach to a solution

and please notice: I don’t want to turn off buffering in all of my php configuration I just want this to happen in the chat script

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T03:06:43+00:00Added an answer on June 15, 2026 at 3:06 am

    Upgrade your nginx server {} config:

    fastcgi_keep_conn on; # < solution
    
    proxy_buffering off;
    gzip off;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP/MySQL driven site, which I have not maintained for the past
I have a Java chat-like application using Comet using Grizzly Comet, which works in
I have a chat-like application which uses Grizzly Comet in Glassfish and the HTTP
Someone have any sample of Comet app .net? I need one sample how to
I have read some posts about this topic and the answers are comet, reverse
I have written a dynamic database driven, object oriented website with an administration frontend
I might be misunderstanding what it means for nginx to be event-driven opposed to
I have been perpetually intrigued by test-driven development, but I can never follow through
While simple, interface-driven event notification frameworks in Java have been around since pre-Cambrian times
I have been using a php sql system to manage images on my website.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.