You are here

Drupal 8 nginx 错误排查:an upstream response is buffered to a temporary file while reading upstream

作者:亚艾元技术部

Drupal 8 网站部署的nginx有时候反应有点慢,经过查看日志,特别是错误日志,存在大量这种信息:

an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/7/74/0000035747 while reading upstream


对应的解决办法,添加以下设置:

proxy_buffers 16 16k; 
proxy_buffer_size 16k;

 

 

设置完毕以后,观察一下。参考网址

 

https://serverfault.com/questions/587386/an-upstream-response-is-buffered-to-a-temporary-file

 

另外一个参考文章给出的配置:

https://itbeginner.net/fix-nginx-upstream-response-buffered-temporary-file-error.html

location ~ \.php$ {
        root           /usr/share/nginx/html;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        fastcgi_max_temp_file 0;
        fastcgi_buffer_size 4K;
        fastcgi_buffers 64 4k;
        include        fastcgi_params;
    }


 

增加了三项配置:

        fastcgi_max_temp_file 0;
        fastcgi_buffer_size 4K;
        fastcgi_buffers 64 4k;


 



论坛:

Drupal版本: