#1561 closed defect (duplicate)

HTTP/2 without SSL not working

Reported by: colemar@… Owned by:
Priority: minor Milestone:
Component: nginx-core Version: 1.10.x
Keywords: http2 ssl Cc:
uname -a: Linux colm 4.4.0-101-generic #124-Ubuntu SMP Fri Nov 10 18:29:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.10.3 (Ubuntu) built with OpenSSL 1.0.2g 1 Mar 2016 TLS SNI support enabled configure arguments: --with-cc-opt='-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -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-Q158zN/nginx-1.10.3/debian/modules/nginx-auth-pam --add-module=/build/nginx-Q158zN/nginx-1.10.3/debian/modules/nginx-dav-ext-module --add-module=/build/nginx-Q158zN/nginx-1.10.3/debian/modules/nginx-echo --add-module=/build/nginx-Q158zN/nginx-1.10.3/debian/modules/nginx-upstream-fair --add-module=/build/nginx-Q158zN/nginx-1.10.3/debian/modules/ngx_http_substitutions_filter_module

Description

server {
        listen 8000 http2;
        server_name weird;
        root /var/www/html;
}
root@colm:/etc/nginx/sites-enabled# curl -s http://localhost:8000 | xxd
00000000: 0000 1204 0000 0000 0000 0300 0000 8000  ................
00000010: 0400 0100 0000 0500 ffff ff00 0004 0800  ................
00000020: 0000 0000 7fff 0000 0000 0807 0000 0000  ................
00000030: 0000 0000 0000 0000 01                   .........

root@colm:/etc/nginx/sites-enabled# curl -s http://localhost:8000/robots.txt | xxd
00000000: 0000 1204 0000 0000 0000 0300 0000 8000  ................
00000010: 0400 0100 0000 0500 ffff ff00 0004 0800  ................
00000020: 0000 0000 7fff 0000 0000 0807 0000 0000  ................
00000030: 0000 0000 0000 0000 01                   .........

Returned data is always the same weird sequence of 56 bytes.

http://nginx.org/en/docs/http/ngx_http_core_module.html#listen
The http2 parameter (1.9.5) configures the port to accept HTTP/2 connections. Normally, for this to work the ssl parameter should be specified as well, but nginx can also be configured to accept HTTP/2 connections without SSL.

Change History (1)

comment:1 Changed 18 months ago by mdounin

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #808.

Note: See TracTickets for help on using tickets.