Amazon Lightsail + NginxでHTTP/2を有効にする
本題について
Amazon LightsailでNginxを利用していますが、HTTPバージョンが1.1でした。
※以下図、ChromeのデベロッパーツールProtocolでは"http/1.1"と表示
Lightsail上でのNginxにおいて、HTTP/2のアップデート方法を検索したのですが、意外に見つからず。
学習がてらメモ要素も含みつつ、手順をここに記載します。
設定自体は大変簡単でした。
環境
1.Nginxのconfで以下を設定
Nginxのconfファイルにて、listen箇所にhttp2を追加するだけでした。
conf
# HTTPS server
server {
listen 443 ssl http2;
server_name example.com;
・・・
}
2.Nginx再起動
$ sudo /opt/bitnami/ctlscript.sh restart nginx
以下図より、デベロッパーツールにて、Protocolに"h2"と表示されました。
参考
Author And Source
この問題について(Amazon Lightsail + NginxでHTTP/2を有効にする), 我々は、より多くの情報をここで見つけました https://qiita.com/TakahashiMasaya/items/eefbbdc50be95287cefa著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .