下载大文件60秒后,NGINX 499错误代码

时间:2019-05-15 11:27:15

标签: java nginx timeout

我正面临这个问题,其中每当我尝试从Web应用程序下载报告(pdf / csv)文件时,都会在60秒后超时。下面是架构。

WEB DOMAIN-> WEB NGINX-> ANGULAR FRONTEND-> API NGINX-> JAVA API。

因此,一旦我删除了API端nginx。报告下载工作正常,但我需要Websocket配置,因此无法删除它。

我尝试添加代理超时,但是它不起作用。请建议可以做什么。

我尝试更改ALB超时并添加了porxy超时。

下面是我的Nginx.conf:

user  nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;

events {
    worker_connections  4096;
}
http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;
    #gzip  on;

#   include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
#   include /etc/nginx/sites-available/*;
}

下面是VM cong:

map $http_upgrade $connection_upgrade {
    default upgrade;
    ''      close;
}
server {

    listen 80;
        server_name _;

        location / {
         include proxy_params;
         proxy_connect_timeout       600;
         proxy_send_timeout          600;
         proxy_read_timeout          600;
         send_timeout                600;
         proxy_ignore_client_abort   on;

         proxy_http_version 1.1;
         proxy_pass http://localhost:8080;
         proxy_set_header Connection "";
}
        location /afcsIndore-stomp/  {
         proxy_http_version 1.1;
         proxy_set_header Upgrade $http_upgrade;
         proxy_set_header Connection "upgrade";
         proxy_pass http://localhost:8080;
}    
}

0 个答案:

没有答案