This article is a mirror article of machine translation, please click here to jump to the original article.

View: 4211|Reply: 3

Nginx adds HTTP/2 protocol enabled

[Copy link]
Posted on 5/7/2022 7:13:24 PM | | | |
The HTTP/2 protocol is version 2.0 of the Hypertext Transfer Protocol, the next generation of the HTTP protocol. HTTP 2.0 provides HTTP semantically optimized shipping with the ability to reuse HTTP requests and responses on a single connection, greatly improving request/response efficiency. We recommend that all websites have HTTP/2 enabled.

HTTP/1.x and HTTP/2 protocols are compared
https://www.itsvse.com/thread-10023-1-1.html

First, to enable HTTP/2, Nginx version 1.9 or higher is required, and http_v2_module modules are required. I already have the Nginx service installed on my server and need to recompile Nginx if I add the HTTP/2 protocol.

First, enter the following command to viewPreviously compiled parameters




Go to the nginx-1.20.1 source code, add the --with-http_v2_module parameter, recompile, and the command is as follows:

Don't make install!!!

Back up the previous ngxin file first


Stop the nginx service and replace the nginx file with the following command:

As shown below:



The website is HTTP/2 protocol enabled

Modify the nginx.conf configuration file as follows:


Restart the nginx service, then find an online test website and test it as follows:



(End)




Previous:Nginx uses HTTPS to configure SSL certificates
Next:ASP.NET Core hosts the In-Process and Out-Of-Process models in IIS
Posted on 5/7/2022 10:50:38 PM |
I'm here to learn again...
 Landlord| Posted on 6/12/2022 2:08:41 PM |
QUIC protocol HTTP/3 is officially released
https://www.itsvse.com/thread-10330-1-1.html
 Landlord| Posted on 4/2/2025 4:10:49 PM |
nginx:[warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /data2/middleware/nginx/conf.d/itsvse.conf:2


Old version writing:


How to write the new version:

Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com