例えば、$document_root
という変数の値を確認する方法です。
http {
log_format debug_log_fmt "[DEBUG][$time_local] $document_root";
}
log_format
をhttp
内に設定します。
server {
access_log /var/log/nginx/access.log debug_log_fmt;
}
server
内のaccess_log
にフォーマットを指定します。
log_format
の設定よりも後に設定しないと、debug_log_fmt
が認識できずエラーとなります。
/var/log/nginx/access.log
に以下の内容が出力されます。
[DEBUG][07/Mar/2021:04:50:04 +0000] /var/www/html/path_to_document_root