server zones bug
hailiangchen opened this issue · 4 comments
hailiangchen commented
u5surf commented
@hailiangchen Thanks reporting. We tend to investigate deeply such the behavior, can you let us your nginx(if you have third party fork such as openresty, tengine and so on) version and configuration.
hailiangchen commented
Tengine version: Tengine/2.3.3
nginx version: nginx/1.18.0
u5surf commented
@hailiangchen
You mean you'd like to serve the different port and get their metrics separately.
How about using vhost_traffic_status_filter_by_set_key
like this?
http {
include mime.types;
default_type application/octet-stream;
#vhost_traffic_status_zone shared:vhost_traffic_status:32m;
vhost_traffic_status_zone;
upstream backend {
server localhost:8080;
}
vhost_traffic_status_filter_by_set_key $server_port server::ports::$server_addr;
server {
listen 8081;
location /backend {
proxy_pass http://backend;
}
location /status {
check_status;
vhost_traffic_status_display;
vhost_traffic_status_display_format html;
access_log off;
}
}
server {
listen 8082;
location /backend {
proxy_pass http://backend;
}
}
server {
listen 8083;
location /backend {
proxy_pass http://backend;
}
}
hailiangchen commented
ok, i'll try