Opened 3 years ago

Closed 3 years ago

#2136 closed defect (duplicate)

When I connect http2 to one server on 80 port, then it propagates to other servers on 80 port

Reported by: advancedtechnoking@… Owned by:
Priority: minor Milestone:
Component: nginx-core Version: 1.18.x
Keywords: http2 Cc:
uname -a: Linux vps 5.8.0-41-generic #46-Ubuntu SMP Mon Jan 18 16:48:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.18.0 (Ubuntu)
built with OpenSSL 1.1.1f 31 Mar 2020 (running with OpenSSL 1.1.1i 8 Dec 2020)
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fdebug-prefix-map=/build/nginx-EPhnvI/nginx-1.18.0=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fPIC' --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/ --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-compat --with-debug --with-pcre-jit --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-http_slice_module --with-threads --with-http_addition_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_sub_module


When I use http2 on one server on 80 port, that propogate http2 to other servers on 80 port. I don't know how it's possible.

Example of config:

server {

listen 80 http2;
return 200 'a';


server {

listen 80;
return 200 'b';


Change History (2)

comment:1 by Maxim Dounin, 3 years ago

That's because 'http2' parameter configures listening socket to use HTTP/2 protocol. If the same listening socket is used in multiple server{} blocks, it will use HTTP/2 in all server blocks - since it's the same listening socket.

Duplicate of #1623.

comment:2 by Maxim Dounin, 3 years ago

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.