LoginSignup
0
0

More than 5 years have passed since last update.

NGINX Unit でIPv6のリスナーを追加する

Last updated at Posted at 2018-10-03

公式にも意外と見つからなかったので、備忘録。

NGINX Unit のリスナー設定

例えば some_app のリスナーを設定する時のリクエスト本文は以下だが、

"listeners": {
    "*:37564": {
        "application": "some_app"
    }
}

これだと普通にIPv4でしかLISTENされない。

# lsof -i | grep unitd
unitd     9999 nobody   99u  IPv4  99999      0t0  TCP *:37564 (LISTEN)

IPv6も追加する場合は、NGINX の設定と同様に [::] のように明示的にIPv6を指定する。

"listeners": {
    "*:37564": {
        "application": "some_app"
    },
    "[::]:37564": {
        "application": "some_app"
    }
}

これでIPv4もIPv6もLISTENされる。

# lsof -i | grep unitd
unitd     9999 nobody   99u  IPv4  99999      0t0  TCP *:37564 (LISTEN)
unitd     8888 nobody   99u  IPv6  88888      0t0  TCP *:37564 (LISTEN)
0
0
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
0
0