Nginx log設定
app serverがリクエストの処理にかかった時間をログに記録する
大抵の場合、これがdefault
log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                  '$status $body_bytes_sent "$http_referer" '
                  '"$http_user_agent" "$http_x_forwarded_for"';
- $remote_addr : クライアントのIPアドレス
 - $remote_user : クライアントのユーザ名
 - $time_local : アクセス日時
 - $request : httpの要求URI
 - $status : httpのステータス
 - $body_bytes_sent: 送信バイト数
 - $http_referer : リファラーURL(遷移元URL)
 - $http_user_agent: ユーザエージェント情報(ブラウザ名・バージョン等)
 
$upstream_response_time & $request_time
$request_timemay be due to a client with a slow connection- clientが slow connectionの場合ながくなる
 
$upstream_response_timeはproxy先からレスポンスを受け取るまでの時間$upstream_response_timeと$request_timeを全部記録するとどちらに原因があるが判断に約立つ
log_format main  '$remote_addr - $remote_user [$time_local] "$request" '
                 '$status $body_bytes_sent "$http_referer" '
                 '"$http_user_agent" "$http_x_forwarded_for" '
                 '"$upstream_response_time" "$request_time"'; # <<
SSL/TLS protocolの記録
- Add 
$ssl_cipher 
log_format combined_ssl '$remote_addr - $remote_user [$time_local] '
                        '$ssl_protocol/$ssl_cipher '
                        '"$request" $status $body_bytes_sent '
                        '"$http_referer" "$http_user_agent"';
上記のログを利用するため 443 listenの設定のログで log_formatを利用するように設定
server {
  listen 443;
  ssl on;
  access_log /var/log/nginx/access.log combined_ssl;
  [...]
}