From 0a028041ef5d366a9619d5e6b4ef38d0eac76589 Mon Sep 17 00:00:00 2001 From: Dan Rowe Date: Fri, 29 Jan 2021 12:58:23 -0500 Subject: [PATCH 1/3] Handle Nginx http auth + grafana auth separately Went down a rabbit hole because I had my "admin" type directory protected by http auth, but the individual apps have their own user auth. The passed authorization header was causing problems with Grafana. --- grafana.subfolder.conf.sample | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/grafana.subfolder.conf.sample b/grafana.subfolder.conf.sample index fc8c6f6..bfd4278 100644 --- a/grafana.subfolder.conf.sample +++ b/grafana.subfolder.conf.sample @@ -22,6 +22,10 @@ location ^~ /grafana/ { set $upstream_port 3000; set $upstream_proto http; proxy_pass http://$upstream_grafana:$upstream_port ; + + # Clear Authorization Header if you are using http auth and normal Grafana auth + #proxy_set_header Authorization ""; + rewrite ^/grafana/(.*)$ /$1 break; -} \ No newline at end of file +} From 895ee475598dc60b22f32edb79ffb747d8c97481 Mon Sep 17 00:00:00 2001 From: Dan Rowe Date: Fri, 29 Jan 2021 13:41:00 -0500 Subject: [PATCH 2/3] Update Version Date --- grafana.subfolder.conf.sample | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grafana.subfolder.conf.sample b/grafana.subfolder.conf.sample index bfd4278..c073452 100644 --- a/grafana.subfolder.conf.sample +++ b/grafana.subfolder.conf.sample @@ -1,4 +1,4 @@ -## Version 2020/12/09 +## Version 2021/01/29 # grafana requires environment variables set thus: # environment: # - "GF_SERVER_ROOT_URL=https://my.domain.com/grafana" From a11dc81b1f1e3f9c285203f6bb07278e11577069 Mon Sep 17 00:00:00 2001 From: Dan Rowe Date: Fri, 29 Jan 2021 13:43:10 -0500 Subject: [PATCH 3/3] Handle Nginx http auth + grafana auth separately Now for the subdomain as well. --- grafana.subdomain.conf.sample | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/grafana.subdomain.conf.sample b/grafana.subdomain.conf.sample index f4505cb..250430a 100644 --- a/grafana.subdomain.conf.sample +++ b/grafana.subdomain.conf.sample @@ -1,4 +1,4 @@ -## Version 2020/12/09 +## Version 2021/01/29 # make sure that your dns has a cname set for grafana and that your grafana container is not using a base url server { @@ -35,6 +35,9 @@ server { set $upstream_port 3000; set $upstream_proto http; proxy_pass $upstream_proto://$upstream_app:$upstream_port; + + # Clear Authorization Header if you are using http auth and normal Grafana auth + #proxy_set_header Authorization ""; } }