How to determine the status code of Nginx 499

My setup:

Curl → AWS ELB → Nginx → NodeJS

When the number of requests is High, I run into this problem.

Nginx Access Logs

xx.xx.xx.xx - - [30/Oct/2014:13:23:40 +0000] "POST /some/calls/object HTTP/1.1" 499 0 "-" "curl/7.27.0" xx.xx.xx.xx - - [30/Oct/2014:13:23:40 +0000] "POST /some/calls/object HTTP/1.1" 499 0 "-" "curl/7.27.0" 

Nginx Error Logs

 2014/10/30 13:23:40 [info] 11181#0: *17811 client xx.xx.xx.xx closed keepalive connection 2014/10/30 13:23:40 [info] 11181#0: *17631 epoll_wait() reported that client prematurely closed connection, so upstream connection is closed too while sending request to upstream, client: xx.xx.xx.xx, server: example.com, request: "POST /some/calls/objects HTTP/1.1", upstream: "http://xx.xx.xx.xx:xx/some/calls/object", host: "example.com" 

NodeJS Magazines

 2014-10-30T13:23:40.074Z : info : req.method GET 2014-10-30T13:23:40.074Z : info : req.url /some/calls/objects 2014-10-30T13:23:40.074Z : info : error { message: 'Request Timed Out!' } 2014-10-30T13:23:40.075Z : info : req.method GET 2014-10-30T13:23:40.075Z : info : req.url /some/calls/objects 2014-10-30T13:23:40.075Z : info : error { message: 'Request Timed Out!' } 2014-10-30T13:23:40.075Z : info : error.stack undefined 2014-10-30T13:23:40.076Z : info : error.stack undefined 

Question

according to this link, 499 means that the client closed the connection, but my question is: who is the client in this scenario is ELB closing the connection or curl or nodejs?

I also noticed that nodejs takes 60+ seconds to answer calls, if nodejs encounter the Timed out problem, then it continues to happen again and again.

+5
source share

Source: https://habr.com/ru/post/1205940/


All Articles