なぜ書こうと思ったか
nginxのステータスをnginxで表示しているのですが、なぜか404エラーが出ていていたので。
予兆
nginxのステータスなのに、バックエンドのログにエラーがでていた。
対応方針
nginx_statusとserver-statusにアクセスがきていたので、両方を許容。
対応前
nginx.domain.conf
location ~ /nginx_status {
.....(省略)
対応後
nginx.domain.conf
location ~ /(nginx_|server-)status {
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;
break;
}