﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
1102	keepalive_requests is not supported for HTTP/2 connections	hwyuan@…		"Looks like the limit of `keepalive_requests` is not supported for HTTP/2 connections.

The following are a server config that can reproduce the issue and the access logs with HTTP/2 turned on and off.
{{{
http {
    log_format   main '$remote_addr - $remote_user [$time_local]  $status\t'
                      '$connection\t'
                      '$connection_requests\t';

    access_log   /PATH/TO/LOGS/access.log  main;

    server {
        listen 127.0.0.1:8080 ssl http2;

        ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
        ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;

        keepalive_requests 10;

        location / {
            return 200;
        }
    }

}
}}}

Even though `keepalive_requests` is set to `10`, when keeps visiting `https://127.0.0.1:8080` from a browser, the number of `connection_requests` would just keeps increasing.
{{{
127.0.0.1 - - [11/Oct/2016:21:16:04 +0000]  200	3	1
127.0.0.1 - - [11/Oct/2016:21:16:05 +0000]  200	3	2
127.0.0.1 - - [11/Oct/2016:21:16:05 +0000]  200	3	3
127.0.0.1 - - [11/Oct/2016:21:16:05 +0000]  200	3	4
127.0.0.1 - - [11/Oct/2016:21:16:06 +0000]  200	3	5
127.0.0.1 - - [11/Oct/2016:21:16:06 +0000]  200	3	6
127.0.0.1 - - [11/Oct/2016:21:16:06 +0000]  200	3	7
127.0.0.1 - - [11/Oct/2016:21:16:06 +0000]  200	3	8
127.0.0.1 - - [11/Oct/2016:21:16:06 +0000]  200	3	9
127.0.0.1 - - [11/Oct/2016:21:16:07 +0000]  200	3	10
127.0.0.1 - - [11/Oct/2016:21:16:07 +0000]  200	3	11 <--- keeps increasing
127.0.0.1 - - [11/Oct/2016:21:16:07 +0000]  200	3	12
127.0.0.1 - - [11/Oct/2016:21:16:08 +0000]  200	3	13
127.0.0.1 - - [11/Oct/2016:21:16:08 +0000]  200	3	14
127.0.0.1 - - [11/Oct/2016:21:16:08 +0000]  200	3	15
127.0.0.1 - - [11/Oct/2016:21:16:08 +0000]  200	3	16
127.0.0.1 - - [11/Oct/2016:21:16:08 +0000]  200	3	17
127.0.0.1 - - [11/Oct/2016:21:16:09 +0000]  200	3	18
127.0.0.1 - - [11/Oct/2016:21:16:09 +0000]  200	3	19
127.0.0.1 - - [11/Oct/2016:21:16:09 +0000]  200	3	20
127.0.0.1 - - [11/Oct/2016:21:16:09 +0000]  200	3	21
127.0.0.1 - - [11/Oct/2016:21:16:09 +0000]  200	3	22
127.0.0.1 - - [11/Oct/2016:21:16:10 +0000]  200	3	23
127.0.0.1 - - [11/Oct/2016:21:16:10 +0000]  200	3	24
}}}

But for HTTP/1.1, the `keepalive_requests` directive is respected, and a new connection will be created once the current one has >= 10 requests.
{{{
127.0.0.1 - - [11/Oct/2016:21:13:23 +0000]  200	3	1
127.0.0.1 - - [11/Oct/2016:21:13:28 +0000]  200	3	2
127.0.0.1 - - [11/Oct/2016:21:13:28 +0000]  200	3	3
127.0.0.1 - - [11/Oct/2016:21:13:29 +0000]  200	3	4
127.0.0.1 - - [11/Oct/2016:21:13:29 +0000]  200	3	5
127.0.0.1 - - [11/Oct/2016:21:13:29 +0000]  200	3	6
127.0.0.1 - - [11/Oct/2016:21:13:29 +0000]  200	3	7
127.0.0.1 - - [11/Oct/2016:21:13:30 +0000]  200	3	8
127.0.0.1 - - [11/Oct/2016:21:13:30 +0000]  200	3	9
127.0.0.1 - - [11/Oct/2016:21:13:30 +0000]  200	3	10
127.0.0.1 - - [11/Oct/2016:21:13:31 +0000]  200	6	1 <--- new connection
127.0.0.1 - - [11/Oct/2016:21:13:31 +0000]  200	6	2
127.0.0.1 - - [11/Oct/2016:21:13:31 +0000]  200	6	3
127.0.0.1 - - [11/Oct/2016:21:13:32 +0000]  200	6	4
127.0.0.1 - - [11/Oct/2016:21:13:32 +0000]  200	6	5
127.0.0.1 - - [11/Oct/2016:21:13:32 +0000]  200	6	6
127.0.0.1 - - [11/Oct/2016:21:13:33 +0000]  200	6	7
127.0.0.1 - - [11/Oct/2016:21:13:33 +0000]  200	6	8
127.0.0.1 - - [11/Oct/2016:21:13:33 +0000]  200	6	9
127.0.0.1 - - [11/Oct/2016:21:13:34 +0000]  200	6	10 
127.0.0.1 - - [11/Oct/2016:21:13:34 +0000]  200	9	1 <--- new connection
}}}"	defect	closed	minor		nginx-module	1.11.x	fixed	keepalive_requests, HTTP2		3.16.0-60-generic 80~14.04.1-Ubuntu	"built by gcc 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
built with OpenSSL 1.0.2j  26 Sep 2016
TLS SNI support enabled
configure arguments: --with-http_ssl_module --with-http_v2_module --with-openssl=/PATH/TO/OPENSSL/openssl-1.0.2j"
