Get the most out of your Centmin Mod LEMP stack
Become a Member

Beta Branch increase HTTP/2 http2_max_field_size and http2_max_header_size limits

Discussion in 'Centmin Mod Github Commits' started by eva2000, Mar 20, 2016.

  1. eva2000

    eva2000 Administrator Staff Member

    54,859
    12,239
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,810
    Local Time:
    1:44 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  2. eva2000

    eva2000 Administrator Staff Member

    54,859
    12,239
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,810
    Local Time:
    1:44 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    For requests with very large header and header field sizes over HTTP/2 may run into nginx bad request 400 errors like below due to the defaults for http2_max_field_size and http2_max_header_size limits are 4k and 16k respectively.

    nginx vhost domain's /home/nginx/domains/domain.com/log/error.log with info verbosity
    Code (Text):
    grep -v 'ngx_pagespeed' error.log | tail -20

    Code (Text):
    2016/03/20 06:20:19 [info] 6155#6155: *3 client timed out (110: Connection timed out) while waiting for request, IP, server: 0.0.0.0:443
    2016/03/20 06:20:21 [info] 6156#6156: *16 client exceeded http2_max_field_size limit while processing HTTP/2 connection, client: IP, server: 0.0.0.0:443
    2016/03/20 06:20:22 [info] 6155#6155: *20 client exceeded http2_max_field_size limit while processing HTTP/2 connection, client: IP, server: 0.0.0.0:443
    2016/03/20 06:20:24 [info] 6155#6155: *15 client timed out (110: Connection timed out) while SSL handshaking, client: IP, server: 0.0.0.0:443
    2016/03/20 06:20:45 [info] 6157#6157: *42 client closed connection while SSL handshaking, client: IP, server: 0.0.0.0:443
    2016/03/20 06:20:46 [info] 6155#6155: *43 client IP closed keepalive connection
    2016/03/20 06:26:30 [info] 9020#9020: *11 client exceeded http2_max_header_size limit while processing HTTP/2 connection, client: IP, server: 0.0.0.0:443
    2016/03/20 06:26:31 [info] 9020#9020: *40 client exceeded http2_max_header_size limit while processing HTTP/2 connection, client: IP, server: 0.0.0.0:443
    2016/03/20 06:26:38 [info] 9019#9019: *46 client exceeded http2_max_header_size limit while processing HTTP/2 connection, client: IP, server: 0.0.0.0:443


    defaults for http2_max_field_size and http2_max_header_size limits are 4k and 16k respectively.

    Updated Centmin Mod 123.09beta01 to add these 2 specific settings for HTTP/2 SSL generated Nginx vhosts on centmin.sh menu option 2 or menu option 22 or /usr/bin/nv generated vhost
    Code (Text):
    http2_max_field_size 16k;
    http2_max_header_size 32k;


    HTTP/2 SSL vhost config file context of where it's inserted
    Code (Text):
      include /usr/local/nginx/conf/ssl_include.conf;
    
      http2_max_field_size 16k;
      http2_max_header_size 32k;
      # mozilla recommended
    


    @deltahf seems to have hit those limits :)
     
    Last edited: Mar 20, 2016