10. Keep nginx the latest
• Use nginx mainline version
• stableは安定しているという意味ではなく新機能が追加さ
れず、バグ修正も緊急な修正を除いて行われないというこ
と。すべての新機能やバグ修正はmainlineにて行われるの
で結果的にmainlineが安定している
https://www.nginx.com/blog/nginx-1-6-1-7-released/
• nginxは無停止でのアップデートが可能
• Periodic OpenSSL vulnerability report 😓
11. nginx-build
• nginx builder command written in Go
https://github.com/cubicdaiya/nginx-build
• Automate download, configure and make
• Download OpenSSL, zlib and PCRE. build them
statically ( independent from OS’s library version)
• Support Tengine and OpenResty
12. nginx-build
$ EXPORT $VERSION=1.9.10
$ nginx-build
-clear
-d work
-v $VERSION
-c nginx-build-conf/configure
-m nginx-build-conf/modules3rd.ini
-zlib
-zlibversion=1.2.8
-verbose
-pcre
-pcreversion=8.38
-openssl
-opensslversion=1.0.2f
$ cd work/$VERSION/nginx-$VERSION
$ sudo make install
25. TLS Session Tickets
• Should share ssl_session_ticket_key file between
servers
• Mozilla recommends replace it every day for
forward secrecy
• Previously we changed the key file almost every
month in manual operation😓
26. Update Tickets with Consul
• Inspired by Stretcher (fujiwara👍)
• Key_file is very small (48byte), It can store into a payload
of consul event
• We’re updating key_file twice a day by using Consul
27. Update Tickets with Consul
JOB
Consul
Servers
nginx
Consul
Agent
$ consul event
-name=“ssl-session-ticket-refresh"
$(openssl rand 48 | base64)
nginx
Consul
Agent
nginx
Consul
Agent
cat | jq -r '.Payload' |
base64 -d | base64 -d
> /path/to/ticket.key
service nginx reload
❶
❷ ❷ ❷
❸
30. SPDY to HTTP/2
• In Mobile App, transition to HTTP/2 from SPDY is not
so quickly
• Android 4.x, iOS 8...
• nginx dropped SPDY in 1.9.4, but we need to
transition gracefully in a few and more years
• We need a server that speak both HTTP/2 and SPDY