Nginx information module.
A set of functions for retrieving Nginx-specific implementation details and meta information.
Nginx information module.
A set of functions for retrieving Nginx-specific implementation details and meta information.
Returns the current Nginx subsystem this function is called from. Can be
one of "http" or "stream".
Phases
Returns
string: Subsystem, either "http" or "stream".Usage
kong.nginx.get_subsystem() -- "http"
Returns various connection and request metrics exposed by Nginx, similar to those reported by the ngx_http_stub_status_module.
The following fields are included in the returned table:
connections_active - the current number of active client connections including connections_waiting.connections_reading - the current number of connections where nginx is reading the request header.connections_writing - the current number of connections where nginx is writing the response back to the client.connections_waiting - the current number of idle client connections waiting for a request.connections_accepted - the total number of accepted client connections.connections_handled - the total number of handled connections. Same as connections_accepted unless some resource limits have been reached
(for example, the worker_connections limit).total_requests - the total number of client requests.Returns
table: Nginx connections and requests statisticsUsage
local nginx_statistics = kong.nginx.get_statistics()