Nginx nginx 问题还是 rails 问题

xiaoxiao · September 30, 2014 · Last by xiaoxiao replied at October 01, 2014 · 6983 hits

有一个项目用 nginx+passenger 在跑,今天在 Nginx 日志文件中发现了这么一个问题 Couldn't forward the HTTP response back to the HTTP client: It seems the user clicked on the 'Stop' button in his browser. 当然这不是我点击停止按钮造成的,而是 rails 控制器中处理的动作时间太长造成的,比如类似这样的动作

def handler
     sleep 80  #需要消耗比较多的时间,造成响应超时
     respond_to do |format|
          format.json { render :json=>{:success=>true}}
    end
end

请教一下各位这个问题怎么解决,是从 rails 配置文件中修改呢、还是从 nginx 配置文件中修改呢。还是 passenger 超时问题,怎么修改,谢谢。

我猜是浏览器的错?

找到原因了,是我前台用的有问题

You need to Sign in before reply, if you don't have an account, please Sign up first.