nginxに追加された新モジュール それがhttp/2モジュールです

Download nginxに追加された新モジュール それがHTTP/2モジュールです

If you can't read please download the document

Upload: furandonpig

Post on 24-Jan-2017

787 views

Category:

Software


0 download

TRANSCRIPT

nginx

33#pakeana@furandon_pig

HTTP/2

Twitter ID @furandon_pigNetBSDECMA-262 Edition5.1https://ecma262reading.doorkeeper.jp/ http://riron-db.connpass.comUNIXhttps://yry2.doorkeeper.jp/Live2Dhttps://enjoying-live2d.doorkeeper.jp/

nginxHTTP2??

HTTP2015Webnginx-1.9.5HTTP/2TLS

HTTP/2

HTTP/2

CentOS 7nginx-1.9.5

Windows10firefox

172.16.0.53172.16.0.52

HTTP/2

nginx-1.9.5$ sudo yum install gcc pcre-devel zlib-devel openssl-devel$ curl -O http://nginx.org/download/nginx-1.9.5.tar.gz$ tar zxvf nginx-1.9.5.tar.gz$ cd nginx-1.9.5$ ./configure --prefix=/opt/nginx-1.9.5 --with-http_v2_module$ make$ sudo make install

$ openssl genrsa 2048 > gochiusa.key$ openssl req -new -key gochiusa.key > gochiusa.csr$ openssl x509 -days 3650 -req -signkey \ gochiusa.key < gochiusa.csr > gochiusa.crt

openssl - http://d.hatena.ne.jp/ozuma/20130511/1368284304/opt/nginx-1.9.5/conf$ sudo cp server.key server.crt /opt/nginx-1.9.5/conf/

nginx.conf

nginxHTTP/2(1/2)server { listen 443 ssl http2 default_server; server_name localhost;

ssl_certificate gochiusa.crt; ssl_certificate_key gochiusa.key;

ssl_ciphers "ECDHE-RSA-AES128-GCM-SHA256";

ssl_session_cache off;

location / { root html; index index.html index.htm; }}

nginx

nginx$ sudo /opt/nginx-1.9.5/sbin/nginx$ sudo /opt/nginx-1.9.5/sbin/nginx -s stop

$ sudo /opt/nginx-1.9.5/sbin/nginx -s reload

firefox

HTTP/2(1/2)

nginx

HTTP/2(2/2)"GET /gochiusa_icon/00000231.png HTTP/2.0" 200 177113 "https://172.16.0.53/gochiusa.html"

HTTP/2.0

nginx.confHTTP/2HTTP/1.xHTTP/2

JSON

HAR(1/2)

timings

HAR(2/2) "request": { "bodySize": 0, "method": "GET", "url": "https://172.16.0.53/gochiusa_icon/00000141.png", "httpVersion": "HTTP/2.0", ...... "cache": {}, "timings": { "blocked": 0, "dns": 0, "connect": 0, "send": 0, "wait": 9, "receive": 16 }, "serverIPAddress": "172.16.0.53", "connection": "443"

HAR# blocked, dns, connect, send, wait, receivegrep -A6 timings $1 \| sed -e "s/[\t ]//g" \| paste - - - - - - - - \| sed -e "s/:/ /g" -e "s/,//g" \| awk '{ print $4 "," $6 "," $8 "," $10 "," $12 "," $14 }'

$ grep -A6 timings $1 \| sed -e "s/[\t ]//g" \| paste - - - - - - - - \| sed -e "s/:/ /g" -e "s/,//g" \| awk '{ print $4 "," $6 "," $8 "," $10 "," $12 "," $14 }0,0,0,0,567,360

HTTP/1.xHTTP/2

HTTP/1.xHTTP/1.x

HTTP/2

nginx-1.9.5HTTP/2HTTP/2HTTP/1.xHTTP/2