@@ -59,6 +59,15 @@ static ngx_conf_enum_t ngx_http_vhost_traffic_status_average_method_post[] = {
5959 { ngx_null_string , 0 }
6060};
6161
62+ static ngx_conf_bitmask_t ngx_http_vhost_traffic_status_ignore_status_masks [] = {
63+ { ngx_string ("1xx" ), NGX_HTTP_VHOST_TRAFFIC_STATUS_IGNORE_STATUS_1XX },
64+ { ngx_string ("2xx" ), NGX_HTTP_VHOST_TRAFFIC_STATUS_IGNORE_STATUS_2XX },
65+ { ngx_string ("3xx" ), NGX_HTTP_VHOST_TRAFFIC_STATUS_IGNORE_STATUS_3XX },
66+ { ngx_string ("4xx" ), NGX_HTTP_VHOST_TRAFFIC_STATUS_IGNORE_STATUS_4XX },
67+ { ngx_string ("5xx" ), NGX_HTTP_VHOST_TRAFFIC_STATUS_IGNORE_STATUS_5XX },
68+ { ngx_string ("off" ), NGX_HTTP_VHOST_TRAFFIC_STATUS_IGNORE_STATUS_OFF },
69+ { ngx_null_string , 0 }
70+ };
6271
6372static ngx_command_t ngx_http_vhost_traffic_status_commands [] = {
6473
@@ -217,6 +226,13 @@ static ngx_command_t ngx_http_vhost_traffic_status_commands[] = {
217226 offsetof(ngx_http_vhost_traffic_status_loc_conf_t , stats_by_upstream ),
218227 NULL },
219228
229+ { ngx_string ("vhost_traffic_status_ignore_status" ),
230+ NGX_HTTP_MAIN_CONF |NGX_HTTP_SRV_CONF |NGX_HTTP_LOC_CONF |NGX_CONF_1MORE ,
231+ ngx_conf_set_bitmask_slot ,
232+ NGX_HTTP_LOC_CONF_OFFSET ,
233+ offsetof(ngx_http_vhost_traffic_status_loc_conf_t , ignore_status ),
234+ & ngx_http_vhost_traffic_status_ignore_status_masks },
235+
220236 ngx_null_command
221237};
222238
@@ -1031,6 +1047,8 @@ ngx_http_vhost_traffic_status_merge_loc_conf(ngx_conf_t *cf, void *parent, void
10311047 ngx_conf_merge_value (conf -> bypass_stats , prev -> bypass_stats , 0 );
10321048
10331049 ngx_conf_merge_value (conf -> stats_by_upstream , prev -> stats_by_upstream , 1 );
1050+ ngx_conf_merge_bitmask_value (conf -> ignore_status , prev -> ignore_status ,
1051+ (NGX_CONF_BITMASK_SET |NGX_HTTP_VHOST_TRAFFIC_STATUS_IGNORE_STATUS_OFF ));
10341052
10351053 name = ctx -> shm_name ;
10361054
0 commit comments