summaryrefslogtreecommitdiff
path: root/netdata/nginx-netdata.conf
blob: d0d5f06afe4f3dd36f64bd84b78fa5ba4320369e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Netdata — path-based proxy
# Add this location block to the existing swave.lol HTTPS server block in nginx.conf
#
# The trailing slash in proxy_pass strips /netdata/ before forwarding to Netdata.
# Netdata uses relative URLs internally, so path stripping works correctly.
# Netdata container is on monitoring_network at 172.24.0.2, port 19999.

location = /netdata {
    return 301 /netdata/;
}

location /netdata/ {
    auth_request /_authelia-auth;
    auth_request_set $authelia_user $upstream_http_remote_user;
    proxy_pass http://172.24.0.2:19999/;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-Server $host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_read_timeout 86400;
}