Client - Nginx HTTP2 - Apache HTTP1.1 is apparently an RFC violation
Hello, I'm Munou. Before I knew it, my pull request to Deno was merged. Yay!
Problem
As the title suggests, if this is an RFC violation, what happens is that
curl doesn't work
curl: (92) HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)
It seems this happens when HTTP/2 always requires HTTPS communication, but you reverse proxy with Nginx and communicate via HTTP to the backend Apache server.
Workaround: Disable HTTP/2
It seems that discussions about this issue are popping up in various places on Github, in a somewhat silly manner like that.
For now, I've only stopped HTTP/2.
Additionally, in this state, it sometimes becomes inaccessible from MacOS/iOS browsers, and sometimes not, and there's not much information about a solution. If you specify --http1.1 in the curl options, it can be done for now, but...
HTTP2 Specification
According to the HTTP2 specification, it can be used with both HTTP and HTTPS, but browsers seem to only allow HTTPS communication. What the heck...
Ineffective Self-Signed Certificate
On the backend Apache, I tried temporary HTTPS communication with a self-signed certificate, and also on the backend, I added
Protocols h2 http/1.1
and enabled the module with a2enmod, but it still seems to be no good.
Necessity of HTTP/2
Comparing multiple image download speeds with HTTP/1.1 and HTTP/2
Actually, I do want to properly support HTTP/2, but I wonder if it will only be when necessary...
Since this just happened yesterday, it seems I need to investigate a bit more slowly 👀