Grafana v6.0.2 (commit: 3f4c2e7)
Ubuntu 18.04.1 LTS
grafana.ini:
[auth.proxy]
enabled = true
header_name = X-WEBAUTH-USER
header_property = username
auto_sign_up = false
ldap_sync_ttl = 60
[users]
allow_sign_up = true
allow_org_create = false
auto_assign_org = true
api work ok:
request:
curl -H “X-WEBAUTH-USER: user2” http://host:3000/api/user
answer:
{“id”:8,“email”:“user2@localhost”,“name”:"",“login”:“user2”,“theme”:"",“orgId”:1,“isGrafanaAdmin”:false}
but web not working:
curl -H “X-WEBAUTH-USER: user2” http://host:3000/
answer like:
- This could be caused by your reverse proxy settings.
- If you host grafana under subpath make sure your grafana.ini root_url setting includes subpath
- If you have a local dev build make sure you build frontend using: yarn start, yarn start:hot, or yarn build
- Sometimes restarting grafana-server can help
using nginx proxy, config:
proxy_set_header Host $host;
proxy_set_header X-WEBAUTH-USER $user;
proxy_set_header Authorization “”;
Logs grafana when using browser:
lvl=info msg=“Request Completed” logger=context userId=0 orgId=0 uname= method=GET path=/api/dashboards/home status=401 remote_addr=XXX time_ms=0 size=26 referer=“XXX”
lvl=info msg=“Request Completed” logger=context userId=0 orgId=0 uname= method=GET path=/api/login/ping status=401 remote_addr=XXX time_ms=0 size=26 referer=“XXX”
lvl=info msg=“Request Completed” logger=context userId=0 orgId=0 uname= method=GET path=/logout status=302 remote_addr=XXX time_ms=0 size=29 referer=“XXX”