1. 程式人生 > >nginx 升級1.12 開啟HTTP2

nginx 升級1.12 開啟HTTP2

gin category 註意 nginx 服務 linux -- 導出 雲服務器 module

nginx 升級1.12 開啟HTTP2

關於OpenSSL 和 Nginx 新版本的本地編譯安裝就不多說了,我基本都是在linux 雲服務器上搞,註意make 之前給Nginx configure 一下, 使得編譯時導出HTTP2相關的module

.configure --prefix=/etc/nginx --with-http_ssl_module --with-http_v2_module

make 結束後,便會在objs 文件夾中生成按照剛才配置編譯的 nginx,軟連接一下即可,殺掉原來的nginx 服務實例。啟動這個帶有http2 module 的nginx,在網站配置中加入對端口的監聽,並采用HTTP2 協議即可:

nginx 升級1.12 開啟HTTP2