Is it possible to use HAproxy to proxy incoming h2c requests?
I have tried the following configuration using this tutorial:
frontend receiver
mode http
bind *:80
bind *:443 ssl crt-list /some/file alpn h2,h2c,http/1.1
default_backend processor
This configuration works for h2 (HTTP/2 secure) requests and sends HTTP/1.1 requests to the backend. However, it doesn't work for h2c (HTTP/2 cleartext) requests made via curl. I get the following error message:
$ curl --http2-prior-knowledge http://server.com/status
...
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle ...)
> GET /status HTTP/2
...
* http2 error: Remote peer returned unexpected data while we expected SETTINGS frame. Perhaps, peer does not support HTTP/2 properly.
...
curl: (16) Error in the HTTP2 framing layer
I suspect this is because HAProxy is expecting h2 data (instead of h2c) in the response. Any suggestion on what I need to change in the HAProxy configuration to support incoming h2c requests?