75秒后,nginx访问日志中出现大量499状态代码

75秒后,nginx访问日志中出现大量499状态代码,nginx,Nginx,我们在长轮询场景中使用nginx。我们有一个用户安装的客户端,然后它与我们的服务器通信。该服务器中的nginx进程将该请求传递给后端,后端是Python进程。Python进程将请求保存最多650秒 在nginx访问日志中有很多499个条目。记录$request_time显示客户端在75秒后超时。不过,没有一个nginx超时设置为75秒 一些研究表明后端进程可能太慢,但包含这些进程的服务器中没有太多活动。添加更多服务器/进程也无济于事,升级nginx所在的实例也无济于事 以下是nginx配置文件

我们在长轮询场景中使用nginx。我们有一个用户安装的客户端,然后它与我们的服务器通信。该服务器中的nginx进程将该请求传递给后端,后端是Python进程。Python进程将请求保存最多650秒

在nginx访问日志中有很多499个条目。记录$request_time显示客户端在75秒后超时。不过,没有一个nginx超时设置为75秒

一些研究表明后端进程可能太慢,但包含这些进程的服务器中没有太多活动。添加更多服务器/进程也无济于事,升级nginx所在的实例也无济于事

以下是nginx配置文件

nginx.conf

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/*;
}
backend.conf

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;
  }
}
如果您使用不同的“测试”客户端,它会在75秒后超时吗?如果你直接点击后端,它会超时n 75s吗?这是AWS的吗?