How to configure Reverse Proxy on Linux Slackware with Apache and Grafana?

The file /etc/httpd/extra/httpd-ssl.conf looks like this:

<VirtualHost _default_:443>

#   General setup for the virtual host
DocumentRoot "/srv/httpd/htdocs"
ErrorLog "/var/log/httpd/error_log"
TransferLog "/var/log/httpd/access_log"

#   SSL Engine Switch:
#   Enable/Disable SSL for this virtual host.
SSLEngine on

<Location /grafana/>
   ProxyPreserveHost On
   ProxyPassReverse /grafana/

   AuthType basic
   AuthBasicProvider ldap
   AuthName "Restrict Access"
   AuthLDAPBindDN cn=apacheldap,ou=DSA,dc=myu,dc=com
   AuthLDAPBindPassword <password>
   AuthLDAPURL ldap://,dc=myu,dc=com?uid?one TLS
   AuthLDAPGroupAttribute memberUid
   AuthLDAPGroupAttributeIsDN off
   Require ldap-group cn=restrictintranet,ou=groups,dc=myu,dc=com

And in Grafana, in defaults.ini I left it like this:

protocol = https
http_addr =
http_port = 3000
domain =
root_url = %(protocol)s://%(domain)s:%(http_port)s/grafana/
serve_from_sub_path = true

However, when trying to access it says that the URL does not exist. Code 404.

Hi Cesar,
this is my VH config:

<VirtualHost *:443>

	Include /etc/apache2/sites-available/ssl_config.incl

	# We use docker bridge instead of, it might save a bit resources
	ProxyPass /
	ProxyPassReverse /
	RequestHeader unset Authorization
	ProxyRequests Off

	<proxy *>
		AuthName "dahoam"
		Include /etc/apache2/sites-available/ldap_config.incl
		Require ldap-group CN=openhab_users,.....
		RewriteEngine On
		RewriteRule .* - [E=PROXY_USER:%{LA-U:REMOTE_USER},NS]
		RequestHeader set X-WEBAUTH-USER "%{PROXY_USER}e"

	ErrorLog ${APACHE_LOG_DIR}/grafana_error.log
	CustomLog ${APACHE_LOG_DIR}/grafana_access.log combined

Grafana proxy auth config:


1 Like

This helped me! Thanks!