Search code examples
nginxhttp2server-push

How to limit amount of files sent to HTTP 2 / Server Push + Nginx


I'm configuring my server to work with HTTP 2 Server Push.

I could make it work, but or the browser or the nginx is limiting the amount of files to "push" in 10. I have a much bigger list of items (they are below).

Anyone knows if there is something in nginx that I need to config?

Chrome print below... Lok at the Initiator, only 10 items has the "push" Chrome network image

My environment is:

3 Dockers containers. 
1 php 7.3 container;
1 nginx 14.0.0 container;
1 mysql 8 container;

My nginx site config (ommited ssl certificate)

server{
    listen 443 ssl http2 default_server;
    listen [::]:443 ssl http2 default_server;


    client_max_body_size 4M;

    include /etc/nginx/snippets/general-security-headers.conf;

    location / {                
        try_files $uri \$uri /index.php?$args;
        http2_push_preload on;
    }


    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass phpserver;
        fastcgi_index index.php;
        include fastcgi_params;

        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        http2_push_preload on;
    }

}

===== SOLVED ======

Edit: I found the config, it is the "http2_max_concurrent_pushes". I added http2_max_concurrent_pushes 100; in my nginx site config inside the "server" scope


Solution

  • I found the answer =D.

    I found the config that i needed to change. It is the "http2_max_concurrent_pushes". I added http2_max_concurrent_pushes 100; in my nginx site config inside the "server" scope