# HG changeset patch # User Yaroslav Zhuravlev # Date 1404992039 -14400 # Node ID 700487454cf2994f452232dfe8db8b6323619946 # Parent ac7a5ee98768f7a924e3ce006ef85ad7fc083592 Status: documented the query API implementation. diff --git a/xml/en/docs/http/ngx_http_status_module.xml b/xml/en/docs/http/ngx_http_status_module.xml --- a/xml/en/docs/http/ngx_http_status_module.xml +++ b/xml/en/docs/http/ngx_http_status_module.xml @@ -9,7 +9,7 @@ + rev="3">
@@ -32,21 +32,63 @@ This module is available as part of our +upstream backend { + zone upstream_backend 64k; + + server backend1.example.com weight=5; + server backend2.example.com; +} + +proxy_cache_path /data/nginx/cache_backend keys_zone=cache_backend:10m; + server { - location = /status { + server_name backend.example.com; + + location / { + proxy_pass http://backend; + proxy_cache cache_backend; + + health_check; + } + + status_zone server_backend; +} + +server { + listen 127.0.0.1; + + location /upstream_conf { + upstream_conf; + } + + location /status { status; } - status_zone example_server; + location = /status.html { + } } +Examples of status requests with this configuration: + +http://127.0.0.1/status +http://127.0.0.1/status/nginx_version +http://127.0.0.1/status/caches/cache_backend +http://127.0.0.1/status/upstreams +http://127.0.0.1/status/upstreams/backend +http://127.0.0.1/status/upstreams/backend/1 +http://127.0.0.1/status/upstreams/backend/1/weight + + + + The simple monitoring page is shipped with this distribution, accessible as “/status.html” in the default configuration. -It requires the location “/status” to be configured -as shown above. +It requires the locations “/status” and +“/status.html” to be configured as shown above.
diff --git a/xml/ru/docs/http/ngx_http_status_module.xml b/xml/ru/docs/http/ngx_http_status_module.xml --- a/xml/ru/docs/http/ngx_http_status_module.xml +++ b/xml/ru/docs/http/ngx_http_status_module.xml @@ -9,7 +9,7 @@ + rev="3">
@@ -32,21 +32,65 @@ +upstream backend { + zone upstream_backend 64k; + + server backend1.example.com weight=5; + server backend2.example.com; +} + +proxy_cache_path /data/nginx/cache_backend keys_zone=cache_backend:10m; + server { - location = /status { + server_name backend.example.com; + + location / { + proxy_pass http://backend; + proxy_cache cache_backend; + + health_check; + } + + status_zone server_backend; +} + +server { + listen 127.0.0.1; + + location /upstream_conf { + upstream_conf; + } + + location /status { status; } - status_zone example_server; + location = /status.html { + } } +Примеры запросов информации о состоянии, +возможные с данной конфигурацией: + +http://127.0.0.1/status +http://127.0.0.1/status/nginx_version +http://127.0.0.1/status/caches/cache_backend +http://127.0.0.1/status/upstreams +http://127.0.0.1/status/upstreams/backend +http://127.0.0.1/status/upstreams/backend/1 +http://127.0.0.1/status/upstreams/backend/1/weight + + + + В составе дистрибутива nginx имеется простая страница мониторинга, доступная по запросу “/status.html” в стандартной конфигурации. -Для работы этой страницы требуется настроить -location “/status”, как показано выше. +Для работы этой страницы требуется настроить location +“/status” и location “/status.html” +как показано выше.