Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NGINX + PHP-FPM net::ERR_INCOMPLETE_CHUNKED_ENCODING #2100

Closed
apexJCL opened this issue May 13, 2017 · 4 comments
Closed

NGINX + PHP-FPM net::ERR_INCOMPLETE_CHUNKED_ENCODING #2100

apexJCL opened this issue May 13, 2017 · 4 comments

Comments

@apexJCL
Copy link

apexJCL commented May 13, 2017

Operating System Information:

Windows Build Number: 10.0.15063 (15063.296)
Windows Version: Windows 10 Home Single Language x64
Version: 1703

Issue:

Running an NGINX instance with PHP-FPM enabled gives a timeout and an error on console net::ERR_INCOMPLETE_CHUNKED_ENCODING

Steps to reproduce:

  1. Enable/Install WLS
  2. Update/Upgrade (apt update && apt upgrade)
  3. Install NGINX
  4. Install php-fpm
  5. Configure NGINX to use php7.0-fpmsocket and support index.php file
  6. Delete default index and create a new like following:

index.php

<?php
phpinfo();

Behavior:

After enabling both services (service nginx start and service php7.0-fpm start), entering address 127.0.0.1 or localhost renders the phpinfo() but keeps waiting for a request finish. Secods later, on console an error will appear that reads net::ERR_INCOMPLETE_CHUNKED_ENCODING

Accesing the default index.html works alright, so I assume it all relies on php-fpm side

@zippaaa
Copy link

zippaaa commented May 13, 2017

Check out my option
#1851 (comment)

@apexJCL
Copy link
Author

apexJCL commented May 14, 2017

@line117 I already checked your answer, here's what I did:

TL:DR
Adding fastcgi_buffering off; as explained here did the trick, now pages are loading fast and smoothly.

  1. Install NGINX from stable releases (the same as you)
  2. From here on, doing this changes the default user, because installing from Ubuntu repos gives you www-data user, whereas installing from NGINX repos gives you nginx user.
  3. Install php-fpm
  4. In the nginx.conf file, add on the http block the line fastcgi_buffering off;.
  5. Restart nginx and php7.0-fpm service

I'd take a stake (blindly) and assume that the buffering issue it's due to disk access/filesystem related. I guess I can close this issue.

@kojinobumoto
Copy link

After adding fastcgi_buffering off; I've encountered the fastcgi_cache does not work (fastcgi became not to save any cache file).
As being described in nginx's manual, nginx seemed not try to read the response from the FastCGI server.
So, I've increased the fastcgi_buffer_size.

fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;

Now, the net::ERR_INCOMPLETE_CHUNKED_ENCODING had disappeared and fastcgi_cache works.

@DrJLT
Copy link

DrJLT commented Mar 28, 2021

After adding fastcgi_buffering off; I've encountered the fastcgi_cache does not work (fastcgi became not to save any cache file).
As being described in nginx's manual, nginx seemed not try to read the response from the FastCGI server.
So, I've increased the fastcgi_buffer_size.

fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;

Now, the net::ERR_INCOMPLETE_CHUNKED_ENCODING had disappeared and fastcgi_cache works.

I'm running into a slightly different issue: about 2/5 of the requests hangs, and will eventually load if I keep refreshing.

Using

fastcgi_buffering off;

solved the problem.

I also tried your suggesting with fastcgi_buffer_size, but it didn't help for me. At least in my environment, it seems that the bug is with this module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants