{"action":"created","issue":{"url":"https://api.github.com/repos/grafana/grafana/issues/5976","repository_url":"https://api.github.com/repos/grafana/grafana","labels_url":"https://api.github.com/repos/grafana/grafana/issues/5976/labels{/name}","comments_url":"https://api.github.com/repos/grafana/grafana/issues/5976/comments","events_url":"https://api.github.com/repos/grafana/grafana/issues/5976/events","html_url":"https://github.com/grafana/grafana/issues/5976","id":175406517,"number":5976,"title":"Unable to configure and use proxy datasource when Grafana proxy authorization is enabled","user":{"login":"pzhuk","id":10362976,"avatar_url":"https://avatars.githubusercontent.com/u/10362976?v=3","gravatar_id":"","url":"https://api.github.com/users/pzhuk","html_url":"https://github.com/pzhuk","followers_url":"https://api.github.com/users/pzhuk/followers","following_url":"https://api.github.com/users/pzhuk/following{/other_user}","gists_url":"https://api.github.com/users/pzhuk/gists{/gist_id}","starred_url":"https://api.github.com/users/pzhuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pzhuk/subscriptions","organizations_url":"https://api.github.com/users/pzhuk/orgs","repos_url":"https://api.github.com/users/pzhuk/repos","events_url":"https://api.github.com/users/pzhuk/events{/privacy}","received_events_url":"https://api.github.com/users/pzhuk/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-07T03:45:38Z","updated_at":"2016-09-07T05:19:54Z","closed_at":"2016-09-07T05:05:37Z","body":"I'm submitting a  Bug report regarding the issue with configuration and use of proxy dataource and Grafana proxy authorization enabled.\r\n\r\nSo my current installations includes nginx (reverse proxy mode and proxy authorization gateway) and Grafana as a backend.\r\n\r\ngrafana version: 3.1.1-1470047149\r\ndatasource: graphite 0.9.12\r\nOS: ubuntu 14.04\r\n\r\nWhat I am trying to do: configure nginx as an authorization gateway via basic HTTP authorization by passsing X-WEBAUTH-USER header to downstream\r\n\r\nExpected result: users who passed basic authorization - are auto-logged in to grafana\r\nActual result: users are auto-logged in, but unable to create a data-source, because grafana returns HTTP/415\r\n\r\nLog record (attempt to add data source):\r\n\r\nt=2016-09-07T03:42:01+0000 lvl=info msg=\"Request Completed\" logger=context userId=8 orgId=3 uname=foobar method=PUT path=/api/datasources/9 status=415 remote_addr=a.b.c.d time_ns=0 size=70\r\n\r\n\r\nI've also tried to create datasource when user is logged in manually (not auto-logged), and it works properly - user can add dataource and see graphs normally. However, any auto-logged users, can't see graphs even after that - instead getting error graphs with error (Can't read properly 'length' of undefined)\r\n \r\n\r\nnginx config:\r\n```\r\n   location /grafana {\r\n        auth_basic \"Restricted\";\r\n        auth_basic_user_file /etc/nginx/conf/htpasswd;\r\n        proxy_set_header   X-WEBAUTH-USER $remote_user;\r\n        proxy_pass_request_headers off;\r\n        proxy_pass http://my.grafana.url:3000;\r\n        proxy_set_header   Host \"my.grafana.url\";\r\n        rewrite  ^/grafana$  / break;\r\n        rewrite  ^/grafana(.*)$  $1 break;\r\n    }\r\n```\r\n\r\ngrafana config:\r\n\r\n```\r\n[server]\r\nroot_url = %(protocol)s://%(domain)s:/grafana\r\n[auth.proxy]\r\nenabled = true\r\nheader_name = X-WEBAUTH-USER\r\nheader_property = username\r\nauto_sign_up = true\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/grafana/grafana/issues/comments/245177927","html_url":"https://github.com/grafana/grafana/issues/5976#issuecomment-245177927","issue_url":"https://api.github.com/repos/grafana/grafana/issues/5976","id":245177927,"user":{"login":"pzhuk","id":10362976,"avatar_url":"https://avatars.githubusercontent.com/u/10362976?v=3","gravatar_id":"","url":"https://api.github.com/users/pzhuk","html_url":"https://github.com/pzhuk","followers_url":"https://api.github.com/users/pzhuk/followers","following_url":"https://api.github.com/users/pzhuk/following{/other_user}","gists_url":"https://api.github.com/users/pzhuk/gists{/gist_id}","starred_url":"https://api.github.com/users/pzhuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pzhuk/subscriptions","organizations_url":"https://api.github.com/users/pzhuk/orgs","repos_url":"https://api.github.com/users/pzhuk/repos","events_url":"https://api.github.com/users/pzhuk/events{/privacy}","received_events_url":"https://api.github.com/users/pzhuk/received_events","type":"User","site_admin":false},"created_at":"2016-09-07T05:19:54Z","updated_at":"2016-09-07T05:19:54Z","body":"I am doing that from UI"}}
{"actor":{"display_login":"pzhuk"}}