Skip to content

Nginx

Auto-Detection
Health Check
Built-in Metrics
Logs
Tutorial available Monitoring Nginx web server with Bleemeo
Read the tutorial

Nginx is a high-performance web server, reverse proxy, and load balancer.

Glouton detects Nginx by its process and listening port (default: 80).

To enable metrics gathering, ensure Glouton can access the Nginx status page at http://server-address/nginx_status. Add the following to your site definition (e.g. /etc/nginx/sites-enabled/default):

location /nginx_status {
stub_status on;
}

If your Nginx build does not include stub_status, see the ngx_http_stub_status_module documentation.

When using Docker, you can set http_path and http_host via labels:

docker run --label glouton.http_path="/readiness" --label glouton.http_host="my-host" [...]

If auto-detected parameters are incorrect, override them manually:

Terminal window
sudo tee /etc/glouton/conf.d/99-nginx.conf > /dev/null << 'EOF'
service:
# For an Nginx running outside a container
- type: "nginx"
address: "127.0.0.1"
port: 80 # HTTP listener, agent does not support HTTPS here
http_path: "/" # Path used for availability check, not metrics gathering
http_host: "127.0.0.1:80" # Host header sent
# For an additional Nginx running outside a container
- type: "nginx"
instance: "NAME_ASSOCIATED_WITH_YOUR_ADDITIONAL_SERVICE"
address: "127.0.0.1"
port: 81
http_path: "/"
http_host: "127.0.0.1:81"
# For an Nginx running in a Docker container
- type: "nginx"
instance: "CONTAINER_NAME"
address: "172.17.0.2"
port: 80
http_path: "/"
http_host: "127.0.0.1:80"
EOF

Glouton automatically detects configuration changes.

Glouton performs an HTTP check on the configured port and path to verify that Nginx is responding.

Metric Description
service_status Status of Nginx
nginx_requests Number of requests per second
nginx_connections_accepted Number of client connections established per second
nginx_connections_handled Number of client connections processed per second
nginx_connections_active Number of active client connections to Nginx
nginx_connections_waiting Number of idle client connections waiting for a request
nginx_connections_reading Number of connections where Nginx is reading the request header
nginx_connections_writing Number of connections where Nginx is writing the response

Glouton collects Nginx access and error logs for analysis in Bleemeo.