💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
## 问题: an upstream response is buffered to a temporary file ## 中文 第一个问题(“上游响应缓冲到临时文件”)是由一些包含大量内容的页面引起的,通过如下增加缓冲区大小解决的: ``` proxy_buffers 8 16k; proxy_buffer_size 32k; passenger_buffers 8 16k;//实际发现这个不合适,所以我注释了 passenger_buffer_size 32k;//实际发现这个不合适,所以我注释了 ``` 第二个问题(“上游在从上游读取响应头时过早关闭连接”)是通过增加服务器上的内存并将乘客切换到保守的生成模式来解决的。(这似乎与使用一个试图运行后台作业的旧Ruby Gem密切相关。) ![mark](http://qiniu.newthink.cc/blog/20190318/zYV27oFsxd4E.jpg) ## 原文说明: The first problem ("upstream response is buffered to a temporary file") was caused by some pages with a lot of content and was solved by increasing the buffer size as follows: ``` proxy_buffers 8 16k; proxy_buffer_size 32k; passenger_buffers 8 16k; passenger_buffer_size 32k; ``` The second problem ('upstream prematurely closed connection while reading response header from upstream') was solved by increasing the memory on the server and switching Passenger to conservative spawn mode. (It appears to have been closely related to using an old Ruby gem which was trying to run background jobs.) ## 解决参考链接: https://stackoverflow.com/questions/8235168/passenger-nginx-502-bad-gateway-errors-in-production