1
1

More than 5 years have passed since last update.

Docker の nginx オフィシャルイメージで http2 を有効にするには

Posted at

Docker の nginx オフィシャルイメージで http2 を有効にするには

タグ nginx:alpine を使えば良い(2017/04/13現在)

経緯

nginx で http2 を有効にするには、 nginx.conf に次のように書けば良いのだけれど、 nginx:latest を使って試してもうまくいかず、エラーも出ない。

server {
    listen       443 ssl http2;
    ...

nginx 自体は以前から http2 に対応しているが、それだけでは駄目で、 OpenSSL 1.0.2 が必要とのこと。 ところが nginx:latest のベースイメージの debian では、 OpenSSL 1.0.1t がインストールされているので、ベースイメージが更新されるまでは対応しないようだ。
nginx:alpine なら OpenSSL 1.0.2 系がインストールされており、http2 が使える。

参考

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1