net::ERR_INCOMPLETE_CHUNKED_ENCODING nginx

后端 未结 8 1201
无人共我
无人共我 2020-12-15 17:38

I have 2 RoR web applications hosted on 2 different servers. For one particular page, the request is served from the second application. For rest of the pages, the request i

相关标签:
8条回答
  • 2020-12-15 18:30

    100% Working Solution for php & nginx web server

    Issue => net::ERR_INCOMPLETE_CHUNKED_ENCODING nginx

    Step1 : Open /etc/php/7.2/fpm/pool.d [Select your php folder in my case i am using php 7.2]

    Step2 : Edit www.conf file inside pool.d folder

    In my case it's look like this =>

    [inet]
    user = www-data
    group = www-data
    
    listen = 127.0.0.1:9999
    listen.owner = www-data
    listen.group = www-data
    listen.mode = 0660
    listen.allowed_clients = 127.0.0.1
    
    pm = dynamic
    pm.max_children = 5
    pm.start_servers = 2
    pm.min_spare_servers = 1
    pm.max_spare_servers = 3
    pm.max_requests = 5
    
    pm.status_path = /status
    ping.path = /ping
    
    request_terminate_timeout = 10s
    request_slowlog_timeout = 10s
    
    ;
    ; Log files
    ;
    access.log = /var/log/php-fpm/php-fpm.log
    slowlog = /var/log/php-fpm/slow.log
    

    Step3 : Change the value of request_terminate_timeout = 10s (Whatever time you want)

    request_terminate_timeout = 300s
    

    Step4 : Now Save and restart php-fpm (in my case i am using php7.2 so cmd will be)

    sudo service php7.2-fpm restart
    

    Now you can execute your script it will works and will terminate after 300s

    Now one more thing add one more line of syntax fastcgi_read_timeout 300; inside nginx.conf file or your website .conf file [Here is code ]

    user www-data;
    worker_processes 1;
    pid /var/run/nginx.pid;
    
    events {
        worker_connections 1024;
    }
    
    http { 
    include /etc/nginx/conf-enabled/*.conf;
    include /etc/nginx/sites-enabled/*.conf;    
    }
    

    After adding fastcgi_read_timeout 300; it will look like this

    user www-data;
    worker_processes 1;
    pid /var/run/nginx.pid;
    
    events {
        worker_connections 1024;
    }
    
    http { 
    include /etc/nginx/conf-enabled/*.conf;
    include /etc/nginx/sites-enabled/*.conf;
    fastcgi_read_timeout 300; 
    }
    

    Now reload nginx and restart php-fpm by following cmd

    sudo service php7.2-fpm reload
    sudo service nginx reload
    

    Note : The code snippet is run and tested bye me please let me know if you are not able to fix your issue via my answer

    0 讨论(0)
  • 2020-12-15 18:34

    For me the solution was enable proxy_max_temp_file_size

    0 讨论(0)
提交回复
热议问题