| 1 | plugin_name: go.d.plugin |
| 2 | modules: |
| 3 | - meta: |
| 4 | id: collector-go.d.plugin-nginx |
| 5 | plugin_name: go.d.plugin |
| 6 | module_name: nginx |
| 7 | monitored_instance: |
| 8 | name: NGINX |
| 9 | link: https://www.nginx.com/ |
| 10 | categories: |
| 11 | - data-collection.web-servers-and-proxies |
| 12 | icon_filename: nginx.svg |
| 13 | related_resources: |
| 14 | integrations: |
| 15 | list: |
| 16 | - plugin_name: go.d.plugin |
| 17 | module_name: httpcheck |
| 18 | - plugin_name: go.d.plugin |
| 19 | module_name: web_log |
| 20 | - plugin_name: apps.plugin |
| 21 | module_name: apps |
| 22 | - plugin_name: cgroups.plugin |
| 23 | module_name: /sys/fs/cgroup |
| 24 | monitored_instance_name: Containers |
| 25 | alternative_monitored_instances: [] |
| 26 | info_provided_to_referring_integrations: |
| 27 | description: "" |
| 28 | keywords: |
| 29 | - nginx |
| 30 | - web |
| 31 | - webserver |
| 32 | - http |
| 33 | - proxy |
| 34 | overview: |
| 35 | data_collection: |
| 36 | metrics_description: | |
| 37 | This collector monitors the activity and performance of NGINX servers, and collects metrics such as the number of connections, their status, and client requests. |
| 38 | method_description: | |
| 39 | It sends HTTP requests to the NGINX location [stub-status](https://nginx.org/en/docs/http/ngx_http_stub_status_module.html), which is a built-in location that provides metrics about the NGINX server. |
| 40 | default_behavior: |
| 41 | auto_detection: |
| 42 | description: | |
| 43 | By default, it detects NGINX instances running on localhost that are listening on port 80. |
| 44 | On startup, it tries to collect metrics from: |
| 45 | |
| 46 | - http://127.0.0.1/basic_status |
| 47 | - http://localhost/stub_status |
| 48 | - http://127.0.0.1/stub_status |
| 49 | - http://127.0.0.1/nginx_status |
| 50 | - http://127.0.0.1/status |
| 51 | limits: |
| 52 | description: "" |
| 53 | performance_impact: |
| 54 | description: "" |
| 55 | additional_permissions: |
| 56 | description: "" |
| 57 | multi_instance: true |
| 58 | supported_platforms: |
| 59 | include: [] |
| 60 | exclude: [] |
| 61 | setup: |
| 62 | prerequisites: |
| 63 | list: |
| 64 | - title: Enable status support |
| 65 | description: | |
| 66 | Configure [ngx_http_stub_status_module](https://nginx.org/en/docs/http/ngx_http_stub_status_module.html). |
| 67 | |
| 68 | 1. Add a status location |
| 69 | |
| 70 | Create a small server/location that only listens on localhost and exposes `/stub_status`: |
| 71 | |
| 72 | **For local monitoring (default):** |
| 73 | |
| 74 | ```nginx |
| 75 | # /etc/nginx/conf.d/stub_status.conf |
| 76 | server { |
| 77 | listen 127.0.0.1:80; |
| 78 | server_name localhost 127.0.0.1; |
| 79 | |
| 80 | location = /stub_status { |
| 81 | stub_status; # exposes NGINX counters |
| 82 | access_log off; # keep logs clean |
| 83 | allow 127.0.0.1; # only local access |
| 84 | deny all; |
| 85 | } |
| 86 | } |
| 87 | ``` |
| 88 | |
| 89 | **For remote monitoring:** |
| 90 | - Change `listen` to bind to an accessible interface (e.g., `listen 80;`) |
| 91 | - Replace `allow 127.0.0.1;` with your Netdata collector's IP address |
| 92 | - Keep `deny all;` to block other IPs |
| 93 | |
| 94 | 2. Reload NGINX and restart Netdata |
| 95 | |
| 96 | ```bash |
| 97 | nginx -t |
| 98 | # if OK: |
| 99 | systemctl reload nginx # or: nginx -s reload |
| 100 | |
| 101 | systemctl restart netdata |
| 102 | ``` |
| 103 | |
| 104 | After restart, Netdata will auto-detect the endpoint and begin collecting NGINX metrics. |
| 105 | configuration: |
| 106 | file: |
| 107 | name: go.d/nginx.conf |
| 108 | options: |
| 109 | description: | |
| 110 | The following options can be defined globally: update_every, autodetection_retry. |
| 111 | folding: |
| 112 | title: Config options |
| 113 | enabled: true |
| 114 | list: |
| 115 | - name: update_every |
| 116 | description: Data collection interval (seconds). |
| 117 | default_value: 1 |
| 118 | required: false |
| 119 | group: Collection |
| 120 | - name: autodetection_retry |
| 121 | description: Autodetection retry interval (seconds). Set 0 to disable. |
| 122 | default_value: 0 |
| 123 | required: false |
| 124 | group: Collection |
| 125 | |
| 126 | - name: url |
| 127 | description: Target endpoint URL. |
| 128 | default_value: http://127.0.0.1/stub_status |
| 129 | required: true |
| 130 | group: Target |
| 131 | - name: timeout |
| 132 | description: HTTP request timeout (seconds). |
| 133 | default_value: 1 |
| 134 | required: false |
| 135 | group: Target |
| 136 | |
| 137 | - name: username |
| 138 | description: Username for Basic HTTP authentication. |
| 139 | default_value: "" |
| 140 | required: false |
| 141 | group: HTTP Auth |
| 142 | - name: password |
| 143 | description: Password for Basic HTTP authentication. |
| 144 | default_value: "" |
| 145 | required: false |
| 146 | group: HTTP Auth |
| 147 | - name: bearer_token_file |
| 148 | description: "Path to a file containing a bearer token (used for `Authorization: Bearer`)." |
| 149 | default_value: "" |
| 150 | required: false |
| 151 | group: HTTP Auth |
| 152 | |
| 153 | - name: tls_skip_verify |
| 154 | description: Skip TLS certificate and hostname verification (insecure). |
| 155 | default_value: no |
| 156 | required: false |
| 157 | group: TLS |
| 158 | - name: tls_ca |
| 159 | description: Path to CA bundle used to validate the server certificate. |
| 160 | default_value: "" |
| 161 | required: false |
| 162 | group: TLS |
| 163 | - name: tls_cert |
| 164 | description: Path to client TLS certificate (for mTLS). |
| 165 | default_value: "" |
| 166 | required: false |
| 167 | group: TLS |
| 168 | - name: tls_key |
| 169 | description: Path to client TLS private key (for mTLS). |
| 170 | default_value: "" |
| 171 | required: false |
| 172 | group: TLS |
| 173 | |
| 174 | - name: proxy_url |
| 175 | description: HTTP proxy URL. |
| 176 | default_value: "" |
| 177 | required: false |
| 178 | group: Proxy |
| 179 | - name: proxy_username |
| 180 | description: Username for proxy Basic HTTP authentication. |
| 181 | default_value: "" |
| 182 | required: false |
| 183 | group: Proxy |
| 184 | - name: proxy_password |
| 185 | description: Password for proxy Basic HTTP authentication. |
| 186 | default_value: "" |
| 187 | required: false |
| 188 | group: Proxy |
| 189 | |
| 190 | - name: method |
| 191 | description: HTTP method to use. |
| 192 | default_value: GET |
| 193 | required: false |
| 194 | group: Request |
| 195 | - name: body |
| 196 | description: Request body (e.g., for POST/PUT). |
| 197 | default_value: "" |
| 198 | required: false |
| 199 | group: Request |
| 200 | - name: headers |
| 201 | description: "Additional HTTP headers (one per line as key: value)." |
| 202 | default_value: "" |
| 203 | required: false |
| 204 | group: Request |
| 205 | - name: not_follow_redirects |
| 206 | description: Do not follow HTTP redirects. |
| 207 | default_value: no |
| 208 | required: false |
| 209 | group: Request |
| 210 | |
| 211 | - name: vnode |
| 212 | description: Associates this data collection job with a [Virtual Node](https://learn.netdata.cloud/docs/netdata-agent/configuration/organize-systems-metrics-and-alerts#virtual-nodes). |
| 213 | default_value: "" |
| 214 | required: false |
| 215 | group: Virtual Node |
| 216 | examples: |
| 217 | folding: |
| 218 | title: Config |
| 219 | enabled: true |
| 220 | list: |
| 221 | - name: Basic |
| 222 | description: A basic example configuration. |
| 223 | folding: |
| 224 | enabled: false |
| 225 | config: | |
| 226 | jobs: |
| 227 | - name: local |
| 228 | url: http://127.0.0.1/stub_status |
| 229 | - name: HTTP authentication |
| 230 | description: Basic HTTP authentication. |
| 231 | config: | |
| 232 | jobs: |
| 233 | - name: local |
| 234 | url: http://127.0.0.1/stub_status |
| 235 | username: username |
| 236 | password: password |
| 237 | - name: HTTPS with self-signed certificate |
| 238 | description: NGINX with enabled HTTPS and self-signed certificate. |
| 239 | config: | |
| 240 | jobs: |
| 241 | - name: local |
| 242 | url: http://127.0.0.1/stub_status |
| 243 | tls_skip_verify: yes |
| 244 | - name: Multi-instance |
| 245 | description: | |
| 246 | > **Note**: When you define multiple jobs, their names must be unique. |
| 247 | |
| 248 | Collecting metrics from local and remote instances. |
| 249 | config: | |
| 250 | jobs: |
| 251 | - name: local |
| 252 | url: http://127.0.0.1/stub_status |
| 253 | |
| 254 | - name: remote |
| 255 | url: http://192.0.2.1/stub_status |
| 256 | troubleshooting: |
| 257 | problems: |
| 258 | list: [] |
| 259 | alerts: [] |
| 260 | metrics: |
| 261 | folding: |
| 262 | title: Metrics |
| 263 | enabled: false |
| 264 | description: "" |
| 265 | availability: [] |
| 266 | scopes: |
| 267 | - name: global |
| 268 | description: These metrics refer to the entire monitored application. |
| 269 | labels: [] |
| 270 | metrics: |
| 271 | - name: nginx.connections |
| 272 | description: Active Client Connections Including Waiting Connections |
| 273 | unit: connections |
| 274 | chart_type: line |
| 275 | dimensions: |
| 276 | - name: active |
| 277 | - name: nginx.connections_status |
| 278 | description: Active Connections Per Status |
| 279 | unit: connections |
| 280 | chart_type: line |
| 281 | dimensions: |
| 282 | - name: reading |
| 283 | - name: writing |
| 284 | - name: idle |
| 285 | - name: nginx.connections_accepted_handled |
| 286 | description: Accepted And Handled Connections |
| 287 | unit: connections/s |
| 288 | chart_type: line |
| 289 | dimensions: |
| 290 | - name: accepted |
| 291 | - name: handled |
| 292 | - name: nginx.requests |
| 293 | description: Client Requests |
| 294 | unit: requests/s |
| 295 | chart_type: line |
| 296 | dimensions: |
| 297 | - name: requests |