stream_server_traffic_status_display

The `stream_server_traffic_status_display` directive enables the display of traffic statistics for stream servers.

Syntaxstream_server_traffic_status_display;
Defaultnone
Contextserver, location
Argumentsnone

Description

The stream_server_traffic_status_display directive is part of the NGINX stream server traffic status module, facilitating the monitoring of traffic statistics via HTTP. When enabled, it serves an endpoint that provides information regarding traffic flow, connections, and error rates for TCP upstream servers. This can be particularly useful for administrators looking to share real-time traffic stats with monitoring systems or for users accessing the NGINX server through a web interface.

To correctly make use of this directive, it must be placed within a server or location context in the NGINX configuration. The handling for GET and HEAD HTTP methods is explicitly supported, allowing the retrieval of the status data while other methods may return appropriate HTTP errors. The module requires shared memory to be initialized, and if this initialization fails, requests to access statistics will result in a service unavailable response. Control commands can be included in the request URI to modify or reset the traffic statuses dynamically, making this directive highly flexible for operational tasks when managing traffic flow and analysing performance metrics.

Config Example

server {
    listen 8080;
    location /status {
        stream_server_traffic_status_display;
    }
}

Ensure that shared memory is configured properly for this directive to work.

Requests using methods other than GET or HEAD will not be accepted, leading to HTTP errors.

If the module is not enabled or initialized, accessing the status will result in a 501 error.

← Back to all directives