将Apache配置为Grafana的反向代理

时间:2018-03-04 19:11:53

标签: apache reverse-proxy reverse grafana

我尝试配置反向代理以使用域名(IP)启用自动登录 - http://docs.grafana.org/installation/behind_proxy/#running-grafana-behind-a-reverse-proxy。没有登录我无法查看。

httpd.conf

<VirtualHost *:80>
 ServerAdmin webmaster@authproxy
 ServerName authproxy
 ErrorLog "logs/authproxy-error_log"
 CustomLog “logs/authproxy-access_log” common

 <Proxy *>
   AuthType Basic
   AuthName GrafanaAuthProxy
   AuthBasicProvider file
   AuthUserFile /etc/apache2/grafana_htpasswd
   Require valid-user
   RewriteEngine On
   RewriteRule .* - [E=PROXY_USER:%{LA-U:REMOTE_USER},NS]
   RequestHeader set X-WEBAUTH-USER "%{PROXY_USER}e"
 </Proxy>
 RequestHeader unset Authorization
 ProxyRequests Off
 ProxyPass / http://IP:3000/
 ProxyPassReverse / http://IP:3000/

/ etc / apache2 / grafana_htpasswd的内容grafanaid:grafanapwd

grafana.ini

 ;domain = http://IP
 ;root_url = http://IP:3000/
 #################################### Auth Proxy ##########################
 [auth.proxy]
 ;enabled = true
 ;header_name = X-WEBAUTH-USER
 ;header_property = username
 ;auto_sign_up = true
 ;ldap_sync_ttl = 60

0 个答案:

没有答案