Skip to content

Instantly share code, notes, and snippets.

@mgaebler
Last active June 16, 2024 05:50
Show Gist options
  • Save mgaebler/055a08827cdfb95fa84a4a5d7ef2255b to your computer and use it in GitHub Desktop.
Save mgaebler/055a08827cdfb95fa84a4a5d7ef2255b to your computer and use it in GitHub Desktop.
NGINX: Custom JSON status page with stub_status
# Make sure the ngx_http_stub_status_module is installed correctly.
location /status {
add_header Content-Type application/json;
return 200 '{\r
"connections_active": $connections_active,\r
"connections_reading": $connections_reading,\r
"connections_writing": $connections_writing,\r
"connections_waiting": $connections_waiting
}';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment