1, HTTP2.0

Compared with http1.x, HTTP2.0 significantly improves Web performance and further reduces network latency on the basis of full semantic compatibility with HTTP1.1. We now many external websites are using HTTPS, but F12 is still a lot of applications or use http1.1 protocol, since already used HTTPS, http2.0 also need to synchronize arrangements on ps: http2.0 only support HTTPS

2, Nginx added http2.0 module

If Nginx is installed on a Linux server, you can download a tar file to install and configure Nginx locally. If Nginx is installed on a Linux server, you can install and configure Nginx locally. Configure –with-http_v2_module configure –with-http_v2_module configure –with-http_v2_module configure –with-http_v2_module configure

2.1. View the current compiled modules of Nginx

$ ./nginx -V nginx version: Nginx /1.19.6 BUILT by GCC 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) Built with OpenSSL 1.0.2K-fips 26 Jan 2017 TLS SNI support enabled configure arguments: --prefix=/opt/nginx/ --user=www --group=www --prefix=/opt/nginx/ --with-http_ssl_module --with-http_stub_status_moduleCopy the code

2.2, configuration,

Add –with-http_v2_module (arguments); / / add –with-http_v2_module (arguments); ./configure –prefix=/opt/nginx/ –user=www –group=www –prefix=/opt/nginx/ –with-http_ssl_module –with-http_stub_status_module –with-http_v2_module

./configure --prefix=/opt/nginx/ --user=www --group=www --prefix=/opt/nginx/ --with-http_ssl_module --with-http_stub_status_module  --with-http_v2_module 

checking for OS
 + Linux 3.10.0-957.el7.x86_64 x86_64
checking for C compiler ... found
 + using GNU C compiler
 + gcc version: 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) 
checking forgcc -pipe switch ... The found... ... ... creating objs/Makefile Configuration summary + using system PCRE library + using system OpenSSL library + using system zlib library nginx path prefix:"/opt/nginx/"
  nginx binary file: "/opt/nginx//sbin/nginx"
  nginx modules path: "/opt/nginx//modules"
  nginx configuration prefix: "/opt/nginx//conf"
  nginx configuration file: "/opt/nginx//conf/nginx.conf"
  nginx pid file: "/opt/nginx//logs/nginx.pid"
  nginx error log file: "/opt/nginx//logs/error.log"
  nginx http access log file: "/opt/nginx//logs/access.log"
  nginx http client request body temporary files: "client_body_temp"
  nginx http proxy temporary files: "proxy_temp"
  nginx http fastcgi temporary files: "fastcgi_temp"
  nginx http uwsgi temporary files: "uwsgi_temp"
  nginx http scgi temporary files: "scgi_temp"
Copy the code

2.3 Compilation and Replacement

Perform the make, don’t make&install, if executed directly install will replace directly, the make command execution is completed in the build directory objs below a nginx executable file, when we put the original sbin directory nginx executable files backup, Copy the newly compiled nginx binaries to the original execution file location

mv nginx nginx.no.http2.xxxxxx cp .. / nginx - 1.19.6 / objs/nginx.Let's take a look at the new build file module information./nginx -V nginx version: Nginx /1.19.6 BUILT by GCC 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) Built with OpenSSL 1.0.2K-fips 26 Jan 2017 TLS SNI support enabled configure arguments: --prefix=/opt/nginx/ --user=www --group=www --prefix=/opt/nginx/ --with-http_ssl_module --with-http_stub_status_module --with-http_v2_moduleCopy the code

2.4 configuration http2.0

443 SSL http2 listen 443 SSL http2 /nginx -s reload, so we can dynamically compile and add nginx modules without stopping, if we need to install other modules.

Nginx installs HTTP/2