vhost_traffic_status_set_by_filter

The 'vhost_traffic_status_set_by_filter' directive allows conditional filtering of traffic status based on specified parameters during NGINX request handling.

Syntaxvhost_traffic_status_set_by_filter filter_type value;
Defaultnone
Contexthttp, server, location, if in location
Arguments2

Description

The 'vhost_traffic_status_set_by_filter' directive is a part of the NGINX virtual host traffic status module, which is designed to provide detailed traffic statistics for virtual hosts. This directive enables users to specify conditions under which certain traffic data should be collected or filtered based on defined arguments. It accepts two parameters that allow fine control over how traffic data is processed and reported.

When configuring this directive, it is vital to understand how the filtering operates based on the arguments provided. The first argument typically designates the filter type, such as filtering by host, path, or method. The second argument is the specific value to match against for filtering purposes. If the conditions specified are met, the traffic data will be included; if not, it will be excluded from the status logs. This feature is particularly useful for administrators who wish to focus on specific traffic patterns or to ignore irrelevant data.

Config Example

vhost_traffic_status_set_by_filter $host 'example.com';

Ensure that the values provided in the arguments are accurate to avoid unintended exclusions of data.

Be careful when using variables as arguments, as they may not always evaluate as expected if not defined properly.

← Back to all directives