nginx-module-vts is a free, open source monitoring & observability project written in C and released under BSD-2-Clause. It has 3,503 GitHub stars, 489 forks and 11 open issues, and was last pushed 6 days ago. On this registry it ranks #118 of 271 tracked projects in Monitoring & Observability, with 5 head-to-head comparisons available.

What is nginx-module-vts?

nginx-module-vts is an open-source Nginx module that tracks and exposes per-virtual-host traffic statistics — request counts, response codes, and traffic totals — as JSON or HTML, built for Nginx operators who need visibility into vhost traffic without running a separate metrics agent.

What it is

nginx-module-vts is a C module written for Nginx. It lives in the Nginx module ecosystem as a server-level instrumentation layer: once compiled in and enabled with the vhost_traffic_status directive, it counts traffic in-process and publishes the result through a shared memory zone defined by vhost_traffic_status_zone. The statistics are keyed by virtual host and can be grouped, filtered, and split by arbitrary keys, which is what separates it from plain request logging. The project is maintained under the vozlt-nginx-modules topic alongside its siblings, is licensed BSD-2-Clause, and carries 3,503 stars and 489 forks.

The concrete problem it solves is per-vhost traffic accounting without out-of-band log processing. Rather than parsing access logs after the fact to reconstruct how much traffic each host, upstream, or filter key received, the module maintains counters inside Nginx itself and serves them on demand. It replaces the ad hoc combination of log rotation, log parsing, and external aggregation that would otherwise be needed to answer questions such as which virtual host is consuming bandwidth, which upstream is failing, or which user agent dominates a given host. The same counters double as the input for traffic limits, so measurement and enforcement share one source.

Key capabilities

  • vhost_traffic_status_zone defines the shared memory zone that holds all counters, and vhost_traffic_status_dump writes statistics to disk so they survive a reload.
  • vhost_traffic_status_display serves the current status, with vhost_traffic_status_display_format selecting the output format and vhost_traffic_status_display_jsonp enabling JSONP callbacks; vhost_traffic_status_display_sum_key controls the summed key.
  • On-the-fly control of zones: status, reset, and delete operations are exposed for fully, group, and each zones, with separate JSON payloads used by status and by control.
  • vhost_traffic_status_filter, vhost_traffic_status_filter_by_host, and vhost_traffic_status_filter_by_set_key break traffic down by custom keys, bounded by vhost_traffic_status_filter_max_node and deduplicated with vhost_traffic_status_filter_check_duplicate.
  • Traffic limits via vhost_traffic_status_limit, vhost_traffic_status_limit_traffic, and vhost_traffic_status_limit_traffic_by_set_key, applied per server, per filter, or per upstream.
  • Documented use cases for counting traffic by individual country through GeoIP, by storage volume, by user agent, by detailed HTTP status code, and by dynamic DNS, plus excluding the status page itself from the counts.
  • A React Dashboard is provided for consuming the statistics, and the README documents customizing the module both before and after installation.

Who uses it and how

  • Nginx operators running many virtual hosts on one instance who need per-host traffic figures without deploying a separate monitoring daemon.
  • Teams using GeoIP to attribute traffic to individual countries, and teams attributing traffic to individual storage volumes or user agents.
  • Operators who need a granular breakdown of detailed HTTP status codes per host, which plain aggregate counters do not provide.
  • Sites that must keep statistics across restarts, using vhost_traffic_status_dump to persist data permanently rather than losing counters on reload.
  • Environments that enforce traffic ceilings per server, per filter key, or per upstream, using the limit directives against the same counters they report.

Getting started

The README provides an Installation section and a Synopsis. Installation is a build step against Nginx source; no package name, Docker image, or compose file is documented in the facts provided, so the module is compiled and enabled through the vhost_traffic_status_zone and vhost_traffic_status directives.

How it compares

No list of paid products that this project replaces is provided in the facts, and no similar tools are named. It stands alone in this registry.

When to use it — and when not to

A self-hoster must operate an Nginx build toolchain, since the module is compiled in rather than dropped in as a standalone service, and counters live in a shared memory zone whose contents are lost on reload unless vhost_traffic_status_dump is configured. Anyone who needs a vendor-packaged binary, a container image, or coverage of non-Nginx workloads should not pick it. The README is extensive but is organised largely as a directive reference, so the facts give no published version number and no packaged distribution path.

project readme (upstream, from github) — read inline

Nginx virtual host traffic status module

CI Coverage License

Nginx virtual host traffic status module

Table of Contents

Version

GitHub Release

See the GitHub Releases for the latest tagged release.

Test

Run sudo prove -r t after you have installed this module. The sudo is required because the test requires Nginx to listen on port 80.

Dependencies

Compatibility

  • Nginx
    • 1.30.x (last tested: 1.30.4)
    • 1.27.x (last tested: 1.27.3)
    • 1.22.x (last tested: 1.22.0)
    • 1.19.x (last tested: 1.19.6)
    • 1.18.x (last tested: 1.18.0)
    • 1.16.x (last tested: 1.15.1)
    • 1.15.x (last tested: 1.15.0)
    • 1.14.x (last tested: 1.14.0)
    • 1.13.x (last tested: 1.13.12)
    • 1.12.x (last tested: 1.12.2)
    • 1.11.x (last tested: 1.11.10)
    • 1.10.x (last tested: 1.10.3)
    • 1.8.x (last tested: 1.8.0)
    • 1.6.x (last tested: 1.6.3)
    • 1.4.x (last tested: 1.4.7)

Earlier versions is not tested.

Screenshots

screenshot-vts-0


screenshot-vts-1

Installation

  1. Clone the git repository.
shell> git clone git://github.com/vozlt/nginx-module-vts.git
  1. Add the module to the build configuration by adding --add-module=/path/to/nginx-module-vts

  2. Build the nginx binary.

  3. Install the nginx binary.

Installtion with Profile-Guided Optimization

It can be built with Profile-Guided Optimization (PGO) using gcc fprofile options. The detail of the PGO mechanisms has refer to the section 7.4 of this paper. Here is an example of the process to make a PGO supported binary. Please use at your own risk.

  1. Compile with fprofile-generate.
shell> pwd
/somewhere/nginx
shell> CC=gcc ./auto/configure --with-cc-opt='-fprofile-generate -fprofile-dir=./objs' --with-ld-opt='-lgcov' --add-module=/somewhere/nginx-module-vts
shell> make
  1. Execute this module tests.
shell> pwd
/somewhere/nginx-module-vts
shell> sudo PATH=/somewhere/nginx/objs:$PATH prove -r t/000.display_html.t
...(during runtime it records coverage data into .gcda files)
  1. Recompile with fprofile-use
shell> pwd
/somewhere/nginx
shell> CC=gcc ./auto/configure --with-cc-opt='-fprofile-use -fprofile-dir=/somewhere/nginx-module-vts/objs' --with-ld-opt='-lgcov' --add-module=/somewhere/nginx-module-vts
shell> make

Synopsis

http {
    vhost_traffic_status_zone;

    ...

    server {

        ...

        location /status {
            vhost_traffic_status_display;
            vhost_traffic_status_display_format html;
        }
    }
}

Description

This is an Nginx module that provides access to virtual host status information. It contains the current status such as servers, upstreams, caches. This is similar to the live activity monitoring of nginx plus. The built-in html is also taken from the demo page of old version.

First of all, the directive vhost_traffic_status_zone is required, and then if the directive vhost_traffic_status_display is set, can be access to as follows:

  • /status/format/json
    • If you request /status/format/json, will respond with a JSON document containing the current activity data for using in live dashboards and third-party monitoring tools.
  • /status/format/html
    • If you request /status/format/html, will respond with the built-in live dashboard in HTML that requests internally to /status/format/json.
  • /status/format/jsonp
    • If you request /status/format/jsonp, will respond with a JSONP callback function containing the current activity data for using in live dashboards and third-party monitoring tools.
  • /status/format/prometheus
    • If you request /status/format/prometheus, will respond with a prometheus document containing the current activity data.
  • /status/control
    • If you request /status/control, will respond with a J

readme truncated — read the full docs on github

Frequently asked questions

Is nginx-module-vts free to use?

nginx-module-vts is open source under the BSD-2-Clause licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does nginx-module-vts do?

Nginx virtual host traffic status module

What is nginx-module-vts written in?

nginx-module-vts is primarily written in C. Its source is publicly available at https://github.com/vozlt/nginx-module-vts, and it has 3,503 GitHub stars.