Numerous 499 status codes in nginx access log after 75 seconds <p>We are using nginx in a long polling scenario. We have a client that the user installs which then communicates with our server. An nginx process in that server passes that request to backends which are Python processes. The Python process holds the request for up to 650 seconds.</p> <p>In the nginx access log there are a lot of 499 entries. Logging the $request_time shows that the client times out after 75 seconds. None of the nginx timeouts are set to 75 seconds though.</p> <p>Some research suggest that the backend processes might be too slow, but there isn't a lot of activity in the servers containing the processes. Adding more servers/processes also didn't help, neither did upgrading the instance where nginx is.</p> <p>Here are the nginx configuration files.</p> <p>nginx.conf</p> <pre><code>user nobody nogroup; worker_processes 1; worker_rlimit_nofile 131072; pid /run/nginx.pid; events { worker_connections 76800; } http { sendfile on; tcp_nopush on; tcp_nodelay on; types_hash_max_size 2048; keepalive_timeout 65; server_names_hash_bucket_size 64; include /usr/local/openresty/nginx/conf/mime.types; default_type application/octet-stream; log_format combined_edit '$remote_addr - $remote_user [$time_local] ' '"$request" $status $body_bytes_sent ' '"$http_referer" "$http_user_agent" "$request_time"'; access_log /var/log/nginx/access.log combined_edit; error_log /var/log/nginx/error.log; gzip on; gzip_disable "msie6"; include /usr/local/openresty/nginx/conf.d/*.conf; include /usr/local/openresty/nginx/sites-enabled/*; } </code></pre> <p>backend.conf</p> <pre><code>upstream backend { server xxx.xxx.xxx.xxx:xxx max_fails=12 fail_timeout=12; server xxx.xxx.xxx.xxx:xxx max_fails=12 fail_timeout=12; } server { listen 0.0.0.0:80; server_name host; rewrite ^(.*) https://$host$1 permanent; } server { listen 0.0.0:443; ssl_certificate /etc/ssl/certs/ssl.pem; ssl_certificate_key /etc/ssl/certs/ssl.pem; ssl on; server_name host; location / { proxy_connect_timeout 700; proxy_buffering off; proxy_redirect off; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Proto $scheme; proxy_read_timeout 10000; # something really large proxy_pass http://backend; } } </code></pre>