LoginSignup
11
7

More than 5 years have passed since last update.

nginxのproxy_http_versionのデフォルト値が1.0

Posted at

リバースプロキシでNWアプライアンスの管理画面にTLS接続してたんですが、
ファームウェアバージョンアップ以降突如みえなくなったのでどうしたことかと思って
apacheのipベースのvhostに書き換えてみたりしたところつながったりして(apacheならNameベースもいけた)、
nginxだとどうしたことかどっちもいけず、なんでなのnginx?とおもってたところ、
スーパーエンジニアの方から、
nginxがproxyでアップストリームに接続するときにデフォルトでHTTP/1.0を使用しているようで、
proxy_http_version 1.1;を指定すると動いたということで解決しました。

確かにこのへんにそんなんかいてありました。そうだったのかー。
http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_http_version

未確認だけどNWアプライアンスのhttpのバージョンがアップデートで1.0切られたのかな。たぶん。
そんなときはproxy_http_versionを指定しましょうという。

proxy_http_version 1.1;

apacheは以下のあたりをみると、
https://httpd.apache.org/docs/current/ja/mod/mod_proxy.html#envsettings

デフォで1.1で古いのしかしゃべらないアプリ向けにforce-proxy-request-1.0 と proxy-nokeepalive を設定する
ということのようです。だからうまくいったんですね。
勉強になりました。

参考:
http://qiita.com/toritori0318/items/a85d0b1efbd3ea1fc950
https://httpd.apache.org/docs/current/ja/mod/mod_proxy.html#envsettings
http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_http_version

11
7
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
11
7