net::ERR_INCOMPLETE_CHUNKED_ENCODING nginx

后端 未结 8 1200
无人共我
无人共我 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:20

    proxy_set_header Connection keep-alive;


    Full config

    server {
            listen      0000; #//port give by your need
            server_name  aa.com;
            proxy_buffers 16 4k;
            proxy_buffer_size 2k;
    
    
            #charset koi8-r;
    
            #access_log  logs/host.access.log  main;
            location ~ ^/hello/{
                proxy_buffering off;
                proxy_pass http://127.0.0.1:1111; #//port give by your need
                proxy_redirect     off;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Connection keep-alive; 
            }
    
    0 讨论(0)
  • 2020-12-15 18:23

    You might want to check if the user that is running the Nginx worker owns the directory /var/lib/nginx.

    I've learned that when you give a response too big for Nginx, it uses this directory to write as a working directory for temporary files. If the worker process cannot access it, Nginx will terminate the transmission before it completes, thus the error INCOMPLETE_CHUNKED_ENCODING.

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

    For me, the solution was what DfKimer recommended, but instead of /var/lib/nginx it was /var/cache/nginx.

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

    I got this error due to server memory full. hope this helps any one in future.

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

    If proxied server cannot write to /var/lib/nginx, yo do not need to play with file permissions or ownership of that directory. You can change the cache directory of nginx for the context by;

    proxy_temp_path /home/emre/projects/frontend/nginx_temp 1 2;
    

    inside http, server or location contexts of nginx.conf file.

    check http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_temp_path

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

    Bumped into this issue on AWS and found that adding a few proxy_buffer directives to the site config file fixed the issues:

    server {
        ...
    
        location / {
            ...
            proxy_buffers 8 1024k;  
            proxy_buffer_size 1024k;
        }
    }
    
    0 讨论(0)
提交回复
热议问题