I have an Express web server behind Nginx reverse proxy.
The Nginx is configured for HTTP/2.
Is it better to leave the default http1 connection between Nginx and Express, or is there worth in upgrading Express to HTTP/2 also?
I guess there'll be some performance loss since SSL is required on both, but don't know whether multiplexing (and other improvements) will make up for it.
- 1Do you even need https on your backend connections?!Michael Hampton– Michael Hampton2017-12-01 18:03:24 +00:00Commented Dec 1, 2017 at 18:03
- It's not a requirement, I'm just thinking in terms of performance, I guessed that HTTP2 should be faster even in this backend combo.steakoverflow– steakoverflow2017-12-01 18:22:12 +00:00Commented Dec 1, 2017 at 18:22
- So are your backends hosted in some other datacenter than your frontends? There's little other reason to bother with TLS here.Michael Hampton– Michael Hampton2017-12-01 19:29:10 +00:00Commented Dec 1, 2017 at 19:29
- 2Possible duplicate of Use HTTP/2.0 between nginx reverse-proxy and backend webserverJacob Evans– Jacob Evans2017-12-01 22:18:43 +00:00Commented Dec 1, 2017 at 22:18
1 Answer
As of 2017:
nginx does not support HTTP/2 for proxy_pass connections so this is not an option.
In my opinion, there is no huge reason to have HTTP/2 all the way through, in a similar way that HTTPS is not required all the way through.
For more details see the answers to this identical question on StackOverflow: https://stackoverflow.com/questions/41637076/http2-with-node-js-behind-nginx-proxy
As of 2018:
nginx does support HTTP/2 server push for upstream connections since version 1.13.9.
As of 2020:
Google Chrome has removed HTTP/2 server push support from Chrome 106.