connect-timeout

Http request timeout at 2 minutes in NGINX 502 bad gateway in Node app

故事扮演 提交于 2019-12-22 05:27:14
问题 I’m been scratching my head on this timeout issue and hope to get some helps. I have a http request that might take 2.5 minutes to return the response. I have timeout handling in Angular for 3 minutes, and NodeJS for 3 minutes as well. My nginx setting have 200 seconds timeout and my Elastic Load Balancing Connection Timeout is set to 4 minutes. However, I keep seeing the 502 bad gateway nginx 1.4.6 (Ubuntu) error at exact 2 minutes. Is there any part that I miss to have longer timeout? My

Express timeout issue, always getting back response,when forcing blocking operation

给你一囗甜甜゛ 提交于 2019-12-11 05:23:35
问题 I'm trying out the connect-timeout module. I've tried hitting a simple route from the browser var timeout = require('connect-timeout'); app.use(timeout('1s')); app.use(haltOnTimedout); app.get('/timeout', function (req, res) { for (var i = 0; i < 1111211111; i++) {} res.send('d') }) function haltOnTimedout(req, res, next){ if (!req.timedout) next(); } But I'm always getting back in the browser (I thought the timeout would prevent it). Anything I'm not getting here? 回答1: The problem is that