How to get nginx to use http2 using expression

I use an expression with node and nginx as a reverse proxy. I would like to know how to use http / 2 with nginx to serve static content, with all other requests being forwarded to the express API.

Currently, my express server is served via http / 1, and nginx accepts HTTP / 2 connections and forwards them for expression. How to configure nginx to use http / 2 to serve everything in my statics folder, but forward all API requests as http1?

+4
source share
1 answer

I will analyze your questions in two parts:

  • How to take advantage of http / 2.0 for static files from nginx?
  • nginx HTTP/1.1 , nginx ?

1:

http/2.0. pipelining, http/1.1, HOL. TCP- HTTP-. , , , , .

2:

HTTP/1.1 . , nginx http/2.0, - HTTP/1.1 . , nginx HTTP/2.0 - . ticket. , tutorial, nginx http/2.0 ubuntu 16.04.

+2

Source: https://habr.com/ru/post/1660585/


All Articles