如何防止nginx提供http/2服务?

如何防止nginx提供http/2服务?,nginx,debian,http2,Nginx,Debian,Http2,我正在为我的公司制作的一个电子商务网站实施http/2。我在debian jessie上托管了它,发现现在很容易从backports repo获得nginx,它是基于openssl 1.0.2构建的,以支持ALPN(这是现在使用chrome所必需的) 所以我升级了我的libssl,然后升级了我的nginx。令我大吃一惊的是,nginx现在似乎通过http2为我的内容提供服务,尽管我没有将该关键字添加到配置中。Chrome的开发工具在网络选项卡的protocol列中显示h2 通常我会对此感到高兴,

我正在为我的公司制作的一个电子商务网站实施http/2。我在debian jessie上托管了它,发现现在很容易从backports repo获得nginx,它是基于openssl 1.0.2构建的,以支持ALPN(这是现在使用chrome所必需的)

所以我升级了我的libssl,然后升级了我的nginx。令我大吃一惊的是,nginx现在似乎通过http2为我的内容提供服务,尽管我没有将该关键字添加到配置中。Chrome的开发工具在网络选项卡的
protocol
列中显示
h2

通常我会对此感到高兴,但我想在http1.1和http2之间做一些比较测量。我如何强制它再次(暂时)服务于http1.1以进行测量

编辑:添加
nginx-V
的输出以特定于我的版本

$ nginx -V
nginx version: nginx/1.9.10
built with OpenSSL 1.0.2h  3 May 2016
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2' --with-ld-opt='-fPIE -pie -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 --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_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_v2_module --with-http_sub_module --with-http_xslt_module --with-stream --with-stream_ssl_module --with-mail --with-mail_ssl_module --with-threads --add-module=/build/nginx-1.9.10/debian/modules/nginx-auth-pam --add-module=/build/nginx-1.9.10/debian/modules/nginx-dav-ext-module --add-module=/build/nginx-1.9.10/debian/modules/nginx-echo --add-module=/build/nginx-1.9.10/debian/modules/nginx-upstream-fair --add-module=/build/nginx-1.9.10/debian/modules/ngx_http_substitutions_filter_module

http2参数(1.9.5)将端口配置为接受HTTP/2连接


因此,在此端口上配置的任何虚拟服务器都将接受HTTP/2连接。如果您想使用HTTP/2配置某些主机,而其他主机不使用HTTP/2,则必须使用不同的IP或端口。

如果您正在代理,是否尝试过
代理\u HTTP\u版本1.1指令?我正在代理:我的第一个nginx终止TLS,然后它进入Varnish,然后是另一个具有实际应用程序配置的nginx。您是否建议将此指令添加到第一个nginx?Yep,这是建议。我怀疑Varnish会升级http版本,除非在您的Varnish配置中明确指定。我只是希望您有
--disable-http-2
选项,是的,我没有意识到这一点的意义。因此,由于我所有的服务器都在端口443上侦听,因此http2要么全部侦听,要么全部侦听。