通常nginxでアクセスログを吐くにはaccess_logディレクティブを利用するのだけど、streamモジュールによるTCPロードバランサーだとこのディレクティブが使えない。公式ドキュメントにもあるようにaccess_logディレクティブを利用できるのはhttp, server, location, if in location, limit_exceptコンテキストに限られる。(nginxのTCPロードバランサーの設定はstreamコンテキストに記述する。) # # access_log is available in the contexts below # # http, server, location, if in location, limit_except # access_log /var/log/nginx/access.log;