vozlt / nginx-module-vts

Nginx virtual host traffic status module
BSD 2-Clause "Simplified" License
3.17k stars 456 forks source link

Limit results to https protocol #255

Closed Admiral-Noisy-Bottom closed 1 year ago

Admiral-Noisy-Bottom commented 1 year ago

Is it possible to only show https?

All http requests are redirected to https and I'd like to see less 30x return codes shown.

Thanks

u5surf commented 1 year ago

@Admiral-Noisy-Bottom Hi, thanks reporting! I may cosider that it can be satisfied your requirement to use vhost_traffic_status_filter_by_set_key which is specified something key to identify whether https protocol or not. For example it is $scheme.

https://nginx.org/en/docs/http/ngx_http_core_module.html#var_scheme

https://github.com/vozlt/nginx-module-vts#vhost_traffic_status_filter_by_set_key

http {

    vhost_traffic_status_zone;
    vhost_traffic_status_filter_by_set_key $scheme scheme::*;

    ...

    server {

        ...

        vhost_traffic_status_filter_by_set_key $scheme scheme::$server_name;

        location /status {
            vhost_traffic_status_display;
            vhost_traffic_status_display_format html;
        }
    }
}
Admiral-Noisy-Bottom commented 1 year ago

Thank you for replying. That seems to have done the job. :)