skip to Main Content
  • Vaadin 8.4.0
  • @Push(transport = Transport.WEBSOCKET_XHR)
  • Spring boot 2.0.1

We got some nginx errors since vaadin 8.4.0. We test our system on different devices and browsers, but we got no errors. In our log system we found following errors

ngix error log: /error just sometimes, not ever/

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

or

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

or

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

nginx.conf file:

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$1 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;
}

3

Answers


  1. Chosen as BEST ANSWER

    that was bug by vaadin 8.4.0 and fixed in 8.4.1. /atmosphere 2.4.24/ https://github.com/vaadin/framework/issues/10861#issuecomment-386611465


  2. 499 - NGX_HTTP_CLIENT_CLOSED_REQUEST is the status code for the case when a client closes the connection.

    Here you can check more about the Nginx status codes here: https://www.nginx.com/resources/wiki/extending/api/http/

    You could test by using curl and ctrl+c to interrupt the requests.

    Another possible cause is due to a timeout on the client side, normally in a load balancer, therefore by incrementing the timeout (idle timeout) could help to fix the problem

    Login or Signup to reply.
  3. vaadin 8.6.3, Spring boot 2.0.3
    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search