H
H
Hazrat Hajikerimov2017-02-05 13:00:17
Nginx
Hazrat Hajikerimov, 2017-02-05 13:00:17

ERR_SPDY_PROTOCOL_ERROR after enabling HTTP/2 in nginx?

Nginx + Letenscrypt + HTTP2
When connecting to the site from the Chrome browser, there are a lot of errors in the console, in particular, images are not loaded, which is transmitted to the console:

GET https://*****.ru/img/1c383cd30b7c298ab50293adfecb7b18.jpg net::ERR_SPDY_PROTOCOL_ERROR


That is, half of the images are loaded, the other is not.
What could be the problem? why does chrome open SPDY connection when it is open over http2?

There are no antiviruses and the like, there is such a problem on several computers (Ubuntu, Windows, Mac OS checked), so everywhere

Here is the Nginx config:

server {
        listen 80;
        server_name ****.ru  www.****.ru;
        return 301 https://$host$request_uri;
}

server {
        listen 443 ssl http2;
        server_name *****.ru  www.*******.ru;
        root /var/www/********.ru;
        try_files  $uri $uri/ @rewrite;
        index index.php;

        error_log /home/****/logs/********.ru.nginx.error.log;

        # SSL сертификаты
        ssl_certificate /etc/letsencrypt/live/******.ru/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/*******.ru/privkey.pem;

        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers on;

        ssl_dhparam /etc/ssl/certs/dhparam.pem;
        ssl_ciphers '**********';
        ssl_session_timeout 1d;
        ssl_session_cache shared:SSL:50m;

        ssl_stapling on;
        ssl_stapling_verify on;
        add_header Strict-Transport-Security max-age=15768000;

        location ~ /.well-known {
                allow all;
        }

        location ~* ^.+\.(jpg|jpeg|gif|png|ico|svg|js|css|txt|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar)$ {
                access_log off;
                expires 30d;
                break;
        }
        
        location @rewrite {
                rewrite  ^/(.*)$ /index.php?route=$1;
        }

        location ~ \.php$ {
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                include        fastcgi_params;
        }
}


UPD: In FireFox, the same trouble, only it is not output to the console, but the images still do not load

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
a_donov, 2017-09-26
@a_donov

Hello, did you solve the problem? After switching to http / 2, this is on all servers.
I suppose the solution is in nginx.conf
limit_conn_zone $binary_remote_addr zone=perip:20m;
limit_conn perip 20;
But too high values ​​will reduce the performance to high attendance to nothing.
Maybe there are other options?

I
inzem, 2019-07-17
@inzem

I had a problem that the Strict-Transport-Security header was added

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question