summaryrefslogtreecommitdiff
path: root/apache2
diff options
context:
space:
mode:
Diffstat (limited to 'apache2')
-rw-r--r--apache2/conf-available/local-netdata.conf56
1 files changed, 56 insertions, 0 deletions
diff --git a/apache2/conf-available/local-netdata.conf b/apache2/conf-available/local-netdata.conf
new file mode 100644
index 0000000..bd3a6ef
--- /dev/null
+++ b/apache2/conf-available/local-netdata.conf
@@ -0,0 +1,56 @@
+# Apache2 snippet to proxy netdata service
+#
+# example uses:
+#
+#<VirtualHost *:80>
+# ServerName simple.example.org
+#
+# Include conf-available/local-netdata.conf
+#</VirtualHost>
+#
+#<VirtualHost *:443>
+# ServerName complex.example.org
+#
+# Define _NETDATA_SOCKET /var/lib/netdata/netdata.socket
+#
+# DefineExternalAuth pwauth pipe /usr/sbin/pwauth
+# <Location ${_NETDATA_PREFIX/>
+# AuthType Basic
+# AuthName "Netdata service access"
+# AuthBasicProvider external
+# AuthExternal pwauth
+# AllowOverride None
+# Require valid-user
+# </Location>
+#
+# Include conf-available/local-netdata.conf
+#
+# UnDefine _NETDATA_SOCKET
+# UnDefine _NETDATA_PORT
+# UnDefine _NETDATA_PREFIX
+#</VirtualHost>
+
+# Netdata port to proxy into (fake, if Unix socket also provided)
+<IfDefine !_NETDATA_PORT>
+ Define _NETDATA_PORT 19999
+</IfDefine>
+
+# path prefix
+<IfDefine !_NETDATA_PREFIX>
+ Define _NETDATA_PREFIX /netdata
+</IfDefine>
+
+<IfDefine _NETDATA_SOCKET>
+ <Location ${_NETDATA_PREFIX/>
+ ProxyPass unix:${_NETDATA_SOCKET}|http://localhost:${_NETDATA_PORT}/ connectiontimeout=5 timeout=30 keepalive=on
+ ProxyPassReverse unix:${_NETDATA_SOCKET}|http://localhost:${_NETDATA_PORT}/
+ </Location>
+</IfDefine>
+<IfDefine !_NETDATA_SOCKET>
+ <Location ${_NETDATA_PREFIX/>
+ ProxyPass http://localhost:${_NETDATA_PORT}/ connectiontimeout=5 timeout=30 keepalive=on
+ ProxyPassReverse http://localhost:${_NETDATA_PORT}/
+ </Location>
+</IfDefine>
+
+RedirectMatch permanent ${_NETDATA_PREFIX} ${_NETDATA_PREFIX}/