Web Server
The Netdata Web Server is static-threaded
, with a fixed, configurable number of threads.
All the threads are concurrently listening for web requests on the same sockets, and the kernel distributes the incoming requests to them. Each thread uses non-blocking I/O so it can serve any number of web requests in parallel.
It respects the keep-alive
HTTP header to serve multiple HTTP requests via the same connection.
Configuration
Edit netdata.conf
using the edit-config
script
Scroll down to the [web]
section to find the following settings.
Settings
Setting | Default | Description |
---|---|---|
ssl key | /etc/netdata/ssl/key.pem | Declare the location of an SSL key to enable HTTPS. |
ssl certificate | /etc/netdata/ssl/cert.pem | Declare the location of an SSL certificate to enable HTTPS. |
tls version | 1.3 | Choose which TLS version to use. While all versions are allowed (1 or 1.0 , 1.1 , 1.2 and 1.3 ), we recommend 1.3 for the most secure encryption. If left blank, Netdata uses the highest available protocol version on your system. |
tls ciphers | none | Choose which TLS cipher to use. Options include TLS_AES_256_GCM_SHA384 , TLS_CHACHA20_POLY1305_SHA256 , and TLS_AES_128_GCM_SHA256 . If left blank, Netdata uses the default cipher list for that protocol provided by your TLS implementation. |
ses max window | 15 | See single exponential smoothing. |
des max window | 15 | See double exponential smoothing. |
mode | static-threaded | Turns on (static-threaded ) or off (none ) the static-threaded Web Server. See the example to turn off the Web Server and disable the dashboard. |
listen backlog | 4096 | The port backlog. Check man 2 listen . |
default port | 19999 | The listen port for the static Web Server. |
web files owner | netdata | The user that owns the web static files. Netdata will refuse to serve a file that is not owned by this user, even if it has read access to that file. If the user given is not found, Netdata will only serve files owned by user given in run as user . |
web files group | netdata | If this is set, Netdata will check if the file is owned by this group and refuse to serve the file if it's not. |
disconnect idle clients after | 1m | The time in seconds to disconnect web clients after being totally idle. |
timeout for first request | 1m | How long to wait for a client to send a request before closing the socket. Prevents slow request attacks. |
accept a streaming request every | off | Can be used to set a limit on how often a Parent will accept streaming requests from Children in a streaming and replication setup. |
respect do not track policy | no | If set to yes , Netdata will respect the user's browser preferences for Do Not Track (DNT) and storing cookies. If DNT is enabled in the browser, and this option is set to yes , nodes will not connect to any registry. For certain browsers, users must disable DNT and change this option to yes for full functionality. |
x-frame-options response header | `` | Avoid clickjacking attacks, by ensuring that the content is not embedded into other sites. |
allow connections from | localhost * | Declare which IP addresses or full-qualified domain names (FQDNs) are allowed to connect to the Web Server, including the dashboard or HTTP API. This is a global setting with higher priority to any of the ones below. |
allow connections by dns | heuristic | See the access list section for details on using allow settings. |
allow dashboard from | localhost * | |
allow dashboard by dns | heuristic | |
allow badges from | * | |
allow badges by dns | heuristic | |
allow streaming from | * | |
allow streaming by dns | heuristic | |
allow netdata.conf | localhost fd* 10.* 192.168.* 172.16.* 172.17.* 172.18.* 172.19.* 172.20.* 172.21.* 172.22.* 172.23.* 172.24.* 172.25.* 172.26.* 172.27.* 172.28.* 172.29.* 172.30.* 172.31.* UNKNOWN | |
allow netdata.conf by dns | no | |
allow management from | localhost | |
allow management by dns | heuristic | |
enable gzip compression | yes | When set to yes , Netdata web responses will be GZIP compressed, if the web client accepts such responses. |
gzip compression strategy | default | Valid settings are default , filtered , huffman only , rle and fixed . |
gzip compression level | 3 | Valid settings are 1 (fastest) to 9 (best ratio). |
web server threads | `` | How many processor threads the web server is allowed. The default is system-specific, the minimum of 6 or the number of CPU cores. |
web server max sockets | `` | Available sockets. The default is system-specific, automatically adjusted to 50% of the max number of open files Netdata is allowed to use (via /etc/security/limits.conf or systemd), to allow enough file descriptors to be available for data collection. |
custom dashboard_info.js | `` | Specifies the location of a custom dashboard.js file. See customizing the standard dashboard for details. |
Access lists
Netdata supports access lists in netdata.conf
:
[web]
allow connections from = localhost *
allow dashboard from = localhost *
allow badges from = *
allow streaming from = *
allow netdata.conf from = localhost fd* 10.* 192.168.* 172.16.* 172.17.* 172.18.* 172.19.* 172.20.* 172.21.* 172.22.* 172.23.* 172.24.* 172.25.* 172.26.* 172.27.* 172.28.* 172.29.* 172.30.* 172.31.*
allow management from = localhost
*
does string matches on the IPs or FQDNs of the clients.
allow connections from
matches anyone that connects on the Netdata port(s). So, if someone is not allowed, it will be connected and disconnected immediately, without reading even a single byte from its connection. This is a global setting with higher priority to any of the ones below.allow dashboard from
receives the request and examines if it is a static dashboard file or an API call the dashboards do.allow badges from
checks if the API request is for a badge. Badges aren’t matched byallow dashboard from
.allow streaming from
checks if the child willing to stream metrics to this Netdata is allowed. This can be controlled per API KEY and MACHINE GUID instream.conf
. The setting innetdata.conf
is checked before the ones instream.conf
.allow netdata.conf from
checks the IP to allowhttp://netdata.host:19999/netdata.conf
. The IPs listed are all the private IPv4 addresses, including link-local IPv6 addresses. Keep in mind that connections to Netdata API ports are filtered byallow connections from
. So, IPs allowed byallow netdata.conf from
should also be allowed byallow connections from
.allow management from
checks the IPs to allow API management calls. Management via the API is currently supported for health
To check the FQDN of the connection without opening the Netdata Agent to DNS-spoofing, a reverse-dns record must be setup for the connecting host. At connection time, the reverse-dns of the peer IP address is resolved, and a forward DNS resolution is made to validate the IP address against the name-pattern.
Please note that this process can be expensive on a machine that is serving many connections. Each access list has an associated configuration option to turn off DNS-based patterns completely to avoid incurring this cost at run-time:
allow connections by dns = heuristic
allow dashboard by dns = heuristic
allow badges by dns = heuristic
allow streaming by dns = heuristic
allow netdata.conf by dns = no
allow management by dns = heuristic
The three possible values for each of these options are yes
, no
and heuristic
. The heuristic
option disables the check when the pattern only contains IPv4/IPv6 addresses or localhost
, and enables it when wildcards are present that may match DNS FQDNs.
DDoS protection
If you publish your Netdata web server to the internet, you may want to apply some protection against DDoS:
- Use the
static-threaded
web server (it is the default) - Use reasonable
[web].web server max sockets
(e.g default) - Don't use all your CPU cores for Netdata (lower
[web].web server threads
) - Run the
netdata
process with a low process scheduling priority (the default is the lowest) - If possible, proxy Netdata via a full-featured web server (Nginx, Apache, etc.)
Examples
Disable the Web Server
details
Change the number of threads
details
Binding Netdata to multiple ports
details
Enable HTTPS/TLS support
details
Select TLS version
details
Do you have any feedback for this page? If so, you can open a new issue on our netdata/learn repository.