Get the App
SLTechnology News&Howtos  ›  Servers  › 

Let our site support http2 | nginx supports http2

Shulou Source: shulou.com Published: 2022-06-03 05:17:51 09月21日 Update

Previously wrote how to install nginx in Ubuntu: blog.51cto.com/11140372/2335820

Here's how to change the site to http2 (http2 benefits are self-evident, self-Baidu):

wget https://github.com/openssl/openssl/archive/OpenSSL_1_1_1a.tar.gztar zxvf OpenSSL_1_1_1a.tar.gzcd nginx-1.15.8/#http2--with-openssl specified openssl directory via--with-http_v2_module package./ configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_realip_module --with-http_v2_module --with-openssl=../ openssl-OpenSSL_1_1_1amake -j2sudo make install #Finally configure listen 443 ssl http2;server_name localhost;ssl_certificate_key /home/anfang/Downloads/cert/key.pem;ssl_certificate under nginx conf server /home/anfang/Downloads/cert/cert.pem;

This is my nginx configuration file for laravel, now changed to http2:

See me before laravel configuration process: blog.51cto.com/11140372/2335680

Restart nginx here and visit https://yourip. My Chrome version supports http2.

How to determine if a website uses HTTP/2: blog.csdn.net/Edu_enth/article/details/85318840

Among them, key.pem and cert.pem can be generated by openssl. Or download mine: http://down.51cto.com/data/2457495

Tags: Configuration site support it goes without saying through benefits files browsers versions directories websites processes this is pages browsing generation Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Linux Docker Redmi Xiaomi