Opened 4 years ago

Closed 4 years ago

#1034 closed defect (invalid)

http2 is enabled globally for shared ip:port listen directives

Reported by: Ceremony64@… Owned by:
Priority: minor Milestone:
Component: nginx-module Version: 1.10.x
Keywords: http2 Cc:
uname -a: Linux debiansid 4.6.0-1-amd64 #1 SMP Debian 4.6.3-1 (2016-07-04) x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.10.1
built with OpenSSL 1.0.2h 3 May 2016
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-z,relro -Wl,-z,now' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-threads --with-http_addition_module --with-http_geoip_module=dynamic --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module=dynamic --with-http_sub_module --with-http_xslt_module=dynamic --with-stream=dynamic --with-stream_ssl_module --with-mail=dynamic --with-mail_ssl_module --add-dynamic-module=/build/nginx-1.10.1/debian/modules/nginx-auth-pam --add-module=/build/nginx-1.10.1/debian/modules/nginx-dav-ext-module --add-module=/build/nginx-1.10.1/debian/modules/nginx-echo --add-module=/build/nginx-1.10.1/debian/modules/nginx-upstream-fair --add-module=/build/nginx-1.10.1/debian/modules/ngx_http_substitutions_filter_module

Description

When enabling http2 on a ip:port pair for a single server configuration, http2 will be enabled on all servers sharing the same ip and port. If the http2-server configuration has no IP specified, it applies to all configured servers running on the same port.

Example:

server {
	listen 443 ssl http2;
	server_name unusedserver;

	include certificate/unusedserver.conf;

	return 200;
}


server {
	listen 443 ssl default;
	server_name myserver;

	include certificate/myserver.conf;

	return 200;
}


server {
	listen 1337 ssl;
	server_name otherserver;

	include certificate/otherserver.conf;

	return 200;
}

If the browser supports HTTP2 and connects to myserver, it will be a HTTP/2.0 connection. Connecting to otherserver will use HTTP/1.1.

Change History (1)

comment:1 by Maxim Dounin, 4 years ago

Resolution: invalid
Status: newclosed

This is expected behaviour. The "http2" parameter of the listen directive enables HTTP/2 on a listening socket, not in a particular virtual server, see docs.

Note: See TracTickets for help on using tickets.