We have a java web server that can serve content via h2c (pure HTTP / 2 text)
We would like to cancel the proxy connections established using h2 (i.e. standard HTTP / 2 over SSL) to the java server in h2c.
Enabling HTTP / 2 on nginx is quite simple, and handling incoming h2 connections works fine.
How do we tell nginx to proxy a connection using h2c rather than http / 1.1?
Note: a solution other than nginx may be acceptable
server { listen 443 ssl http2 default_server; server_name localhost; ssl_certificate /opt/nginx/certificates/???.pem; ssl_certificate_key /opt/nginx/certificates/???.pk8.key.pem; ssl_session_cache shared:SSL:1m; ssl_session_timeout 5m; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; location / { proxy_pass http://localhost:8080/;
CONCLUSION (June 2016)
This can be done using haproxy, using the configuration file is as simple as the one below.
The request (HttpServletRequest) req.getProtocol() explicitly returns HTTP/2.0
global tune.ssl.default-dh-param 1024 defaults timeout connect 10000ms timeout client 60000ms timeout server 60000ms frontend fe_http mode http bind *:80
source share