nginx 499 错误 vaadin 8,spring 启动

nginx 499 error vaadin 8, spring boot

自 vaadin 8.4.0 以来,我们遇到了一些 nginx 错误。我们在不同的设备和浏览器上测试我们的系统,但没有出现任何错误。在我们的日志系统中,我们发现了以下错误

ngix 错误日志:/错误只是有时,从来没有/

499 | POST /vaadinServlet/HEARTBEAT/?v-uiId=0 HTTP/2.0

499 | POST /vaadinServlet/UIDL/?v-uiId=2 HTTP/2.0

18184#0: *266253 upstream prematurely closed connection while reading response header from upstream

nginx.conf 文件:

server {
    listen xxx.xxx.xxx.xxx:443 ssl http2;

    server_name tld.com;
    server_name www.tld.com;
    server_name ipv4.tld.com;

    ssl_certificate             /opt/psa/var/certificates/cert-xxxxxx;
    ssl_certificate_key         /opt/psa/var/certificates/cert-xxxxxx;
    ssl_client_certificate      /opt/psa/var/certificates/cert-xxxxxx;

    client_max_body_size 128m;

    # disable unsupported ciphers
    ssl_ciphers AESGCM:HIGH:!aNULL:!MD5;

    # ssl optimizations
    ssl_session_cache shared:SSL:60m;
    ssl_session_timeout 60m;
    add_header Strict-Transport-Security "max-age=31536000";

    root "/var/www/vhosts/tld.com/httpdocs";
    access_log "/var/www/vhosts/system/tld.com/logs/proxy_access_ssl_log";
    error_log "/var/www/vhosts/system/tld.com/logs/proxy_error_log";

    if ($host ~* ^www\.tld\.com$) {
            #rewrite ^(.*)$ https://tld.com permanent;
            return 301 https://tld.com$request_uri;
    }


    location / {
            proxy_pass https://xxx.xxx.xxx.xxx:801; #7081 | 801
            proxy_set_header Host             $host;
            proxy_set_header X-Real-IP        $remote_addr;
            proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
            proxy_set_header X-Accel-Internal /internal-nginx-static-location;

            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";

            proxy_connect_timeout   3600;
            proxy_read_timeout      84600s;
            proxy_send_timeout      84600s;
    }

     location ~ ^/(vaadinServlet|VAADIN) {
           proxy_set_header          X-Forwarded-Host        $host;
           proxy_set_header          X-Forwarded-Server      $host;
           proxy_set_header          X-Real-IP               $remote_addr;
           proxy_set_header          X-Forwarded-For         $proxy_add_x_forwarded_for;
           proxy_set_header          Host                    $host;
           proxy_http_version        1.1;
           proxy_set_header          Upgrade                 $http_upgrade;
           proxy_set_header          Connection              "upgrade";
           proxy_buffering           off;
           proxy_ignore_client_abort off;
           proxy_pass                https://xxx.xxx.xxx.xxx:801;
           proxy_read_timeout 84600s;
           proxy_send_timeout 84600s;
           proxy_redirect off;
    }

    location /internal-nginx-static-location/ {
            alias /var/www/vhosts/tld.com/httpdocs/;
            internal;
    }

    location ~ ^/(plesk-stat|awstats-icon|webstat|webstat-ssl|ftpstat|anon_ftpstat) {
            proxy_pass https://xxx.xxx.xxx.xxx:7081;
            proxy_set_header Host             $host;
            proxy_set_header X-Real-IP        $remote_addr;
            proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
            proxy_set_header X-Accel-Internal /internal-nginx-static-location;
            access_log off;
    }

    add_header X-Powered-By PleskLin;

        include "/var/www/vhosts/system/tld.com/conf/vhost_nginx.conf";
}
# VAADIN PUSH
    map $http_upgrade $connection_upgrade {
            default upgrade;
            '' close;
    }


server {
        listen xxx.xxx.xxx.xxx:80;

        server_name tld.com;
        server_name www.tld.com;
        server_name ipv4.tld.com;

        client_max_body_size 128m;

        return 301 https://$host$request_uri;
}

499 - NGX_HTTP_CLIENT_CLOSED_REQUEST是客户端关闭连接时的状态码。

在这里您可以查看更多关于 Nginx 状态代码的信息:https://www.nginx.com/resources/wiki/extending/api/http/

您可以使用 curlctrl+c 中断请求进行测试。

另一个可能的原因是客户端超时,通常是在负载均衡器中,因此增加超时 (idle timeout) 可能有助于解决问题

这是 vaadin 8.4.0 的错误并在 8.4.1 中修复。 /气氛2.4.24/ https://github.com/vaadin/framework/issues/10861#issuecomment-386611465

我需要 8.6.3,Spring 启动 2.0.3