vhost_traffic_status_display_format

The `vhost_traffic_status_display_format` directive defines the format for displaying traffic statistics for virtual hosts in NGINX.

Syntaxvhost_traffic_status_display_format format;
Defaultnone
Contextserver, location
Arguments1

Description

The vhost_traffic_status_display_format directive is used within the NGINX virtual host traffic status module to specify the output format of traffic statistics displayed for various virtual hosts. It can be set at the server or location context level, allowing administrators to customize how traffic data is represented. The directive accepts a single argument which defines the desired format, such as JSON, HTML, or Prometheus, depending on the capabilities of the module and the requirements of the user.

When this directive is set, the NGINX server will generate traffic statistics based on the specified format during requests to the status page. If enabled, the module retrieves data from shared memory zones where traffic metrics are stored. This could include metrics like request counts, transferred bytes, and other relevant data points. Administrators can utilize this feature to monitor traffic flow and performance metrics more efficiently and in a format that suits their analysis tools or dashboard integrations.

Config Example

server {
    location /status {
        vhost_traffic_status_display; 
        vhost_traffic_status_display_format json;
    }
}

Ensure that the specified format is supported by the module; unsupported formats may lead to errors or no display output.

Remember to include the vhost_traffic_status_display directive alongside this directive to enable the display of metrics.

Incorrect placement of this directive outside of the server or location contexts will cause it to be ignored.

← Back to all directives