diff --git a/docs/changes.xml b/docs/changes.xml
index ce67b6383..137df4864 100644
--- a/docs/changes.xml
+++ b/docs/changes.xml
@@ -33,6 +33,13 @@ NGINX Unit updated to 1.31.0.
date="" time=""
packager="Nginx Packaging <nginx-packaging@f5.com>">
+
+
+added unit section to /status endpoint.
+unit section is about web-server version, control_socket and etc.
+
+
+
if building with njs, version 0.8.0 or later is now required.
diff --git a/src/nxt_status.c b/src/nxt_status.c
index f8002e86e..47020ba91 100644
--- a/src/nxt_status.c
+++ b/src/nxt_status.c
@@ -17,6 +17,11 @@ nxt_status_get(nxt_status_report_t *report, nxt_mp_t *mp)
nxt_status_app_t *app;
nxt_conf_value_t *status, *obj, *apps, *app_obj;
+ static nxt_str_t about_str = nxt_string("unit");
+ static nxt_str_t ver_str = nxt_string("version");
+ static nxt_str_t socket_str = nxt_string("control_socket");
+ static nxt_str_t cver_str = nxt_string(NXT_VERSION);
+ static nxt_str_t csocket_str = nxt_string(NXT_CONTROL_SOCK);
static nxt_str_t conns_str = nxt_string("connections");
static nxt_str_t acc_str = nxt_string("accepted");
static nxt_str_t active_str = nxt_string("active");
@@ -29,17 +34,27 @@ nxt_status_get(nxt_status_report_t *report, nxt_mp_t *mp)
static nxt_str_t run_str = nxt_string("running");
static nxt_str_t start_str = nxt_string("starting");
- status = nxt_conf_create_object(mp, 3);
+ status = nxt_conf_create_object(mp, 4);
if (nxt_slow_path(status == NULL)) {
return NULL;
}
+ obj = nxt_conf_create_object(mp, 2);
+ if (nxt_slow_path(obj == NULL)) {
+ return NULL;
+ }
+
+ nxt_conf_set_member(status, &about_str, obj, 0);
+
+ nxt_conf_set_member_string(obj, &ver_str, &cver_str, 0);
+ nxt_conf_set_member_string(obj, &socket_str, &csocket_str, 1);
+
obj = nxt_conf_create_object(mp, 4);
if (nxt_slow_path(obj == NULL)) {
return NULL;
}
- nxt_conf_set_member(status, &conns_str, obj, 0);
+ nxt_conf_set_member(status, &conns_str, obj, 1);
nxt_conf_set_member_integer(obj, &acc_str, report->accepted_conns, 0);
nxt_conf_set_member_integer(obj, &active_str, report->accepted_conns
@@ -53,7 +68,7 @@ nxt_status_get(nxt_status_report_t *report, nxt_mp_t *mp)
return NULL;
}
- nxt_conf_set_member(status, &reqs_str, obj, 1);
+ nxt_conf_set_member(status, &reqs_str, obj, 2);
nxt_conf_set_member_integer(obj, &total_str, report->requests, 0);
@@ -62,7 +77,7 @@ nxt_status_get(nxt_status_report_t *report, nxt_mp_t *mp)
return NULL;
}
- nxt_conf_set_member(status, &apps_str, apps, 2);
+ nxt_conf_set_member(status, &apps_str, apps, 3);
for (i = 0; i < report->apps_count; i++) {
app = &report->apps[i];