Es geistern mehrere Lösungen rum, die netdata mit basic auth und nginx abzusichern.
Es geht aber auch mit einer reinen Apache Lösung, die auch in der Doku von netdata beschrieben ist.
Hier meine Gedächtnisstütze.
ich verwende ISPconfig, entsprechend sind hier die notwendigen Einträge bei der Website in der Config.
Apache Direktiven:
RewriteEngine on RewriteRule ^/\.well-known/carddav /nextcloud/remote.php/dav [R=301,L] RewriteRule ^/\.well-known/caldav /nextcloud/remote.php/dav [R=301,L] RewriteRule ^/\.well-known/webfinger /nextcloud/index.php/.well-known/webfinger [R=301,L] RewriteRule ^/\.well-known/nodeinfo /nextcloud/index.php/.well-known/nodeinfo [R=301,L] Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains" Require all granted # Local Netdata server accessed with '/netdata/', at localhost:19999 ProxyPass "/netdata/" "http://localhost:19999/" connectiontimeout=5 timeout=30 keepalive=on #ProxyPass "/netdata/" "unix:/var/run/netdata/netdata.sock|http://localhost:19999/" connectiontimeout=5 timeout=30 keepalive=on If ProxyPassReverse "/" "http://localhost:19999/" # if the user did not give the trailing /, add it # for HTTP (if the virtualhost is HTTP, use this) RewriteRule ^/netdata$ http://%{HTTP_HOST}/netdata/ [L,R=301] # for HTTPS (if the virtualhost is HTTPS, use this) #RewriteRule ^/netdata$ https://%{HTTP_HOST}/netdata/ [L,R=301] # add a section AuthType Basic AuthName "Protected site" AuthUserFile /etc/apache2/.htpasswd Require valid-user Order deny,allow Allow from all
Damit ist Let's Encrypt frei Haus, da die Hauptdomain bereits ssl enabled ist.
Jetzt nicht vergessen, mit
htpasswd -c /etc/apache2/.htpasswd monitoruser
einen user für die "basic auth" anzulegen.
und dann kann in /etc/netdata/netdata.conf bind auf localhost gestellt werden.