docker window: access token is missing when using github oauth with Grafana

I am trying to use github oauth with Grafana. The error in the grafana records is

msg = login.OAuthLogin (NewTransportWithCode) logger = context userId = 0 orgId = 0 uname = error = "oauth2: server response is missing access_token"

I executed the following command inside the graffiti container to make sure I get a valid github response:

roll up - request POST 
--url & # 39; https: //github.com/login/oauth/access_token' 
--header & # 39; content-type: application / json & # 39; 
--data & # 39; {"grant_type": "permission_code", "client_id": "CLIENT_ID", "client_secret": "CLIENT_SECRECT", "code": "6ccfdded0ffe5518bc56", "redirect_uri": "https: // grafana .mydomain. is / login / github "} & # 39;

The answer is similar to what I would expect.
access_token = 8f8a62bbd616f4545f97a1d4cd9931abf56f4245 & scope = user% 3Aemail & token_type = bearergrafana

Grafana settings

"GF_AUTH_GITHUB_ENABLED = True",
"GF_LOG_LEVEL = debugging",
"GF_AUTH_GITHUB_AUTH_URL = https: //github.com/login/oauth/authorize",
"GF_SERVER_DOMAIN = mydomain.com",
"GF_AUTH_GITHUB_ALLOW_SIGN_UP = False",
"GF_SERVER_ROOT_URL = https: //grafana.mydomain.com",
"GF_SERVER_ROUTER_LOGGING = True",
"GF_SECURITY_LOGIN_REMEMBER_DAYS = 7",
"GF_SECURITY_SECRECT_KEY = MY_SECRECT",
"GF_SECURITY_ADMIN_USER = admin",
"GF_SECURITY_ADMIN_PASSWORD = password",
"GF_AUTH_GITHUB_SCOPES = user: email",
"GF_AUTH_GITHUB_TOKEN_URL = https: //github.com/login/oauth/access_token",
"GF_AUTH_GITHUB_CLIENT_ID = CLIENT_ID",
"GF_AUTH_GITHUB_API_URL = https: //api.github.com/user",
"GF_AUTH_GITHUB_CLIENT_SECRECT = CLIENT_SECRECT",
"PATH = / usr / share / grafana / bin: / usr / local / sbin: / usr / local / bin: / usr / sbin: / usr / bin: / sbin: / bin",
"GF_PATHS_CONFIG = / etc / grafana / grafana.ini",
"GF_PATHS_DATA = / var / lib / grafana",
"GF_PATHS_HOME = / usr / share / grafana",
"GF_PATHS_LOGS = / var / log / grafana",
"GF_PATHS_PLUGINS = / var / lib / grafana / plugins",
"GF_PATHS_PROVISIONING = / etc / grafana / provisioning"

HAProxy Config

default
global log
http mode
Httplog option
dontlognull option
standby time connect 10000
Customer waiting time 180000
180000 standby server
errorfile 400 /etc/haproxy/errors/400.http
errorfile 502 /etc/haproxy/errors/502.http
error file 503 /etc/haproxy/errors/503.http
error file 504 /etc/haproxy/errors/504.http

frontend ft_http
link 0.0.0.0:80
bind 0.0.0.0:443 ssl crt /etc/ssl/cert.pem crt /etc/ssl/cert2.pem
redirect https scheme yes! {ssl_fc}
http mode
Option http-server-close
Forwarding option
acl host_grafana hdr (host) -i grafana.mydomain.com
use_backend bk_grafana if host_grafana
default_backend no_match

backend bk_grafana
http mode
Forwarding option
option httpchk HEAD / HTTP / 1.1  r  nHost: localhost
Grafana Server 172.31.28.99:3000 check
http-request set-header X-Forwarded-Port%[dst_port]
  http-request add-header X-Forwarded-Proto https yes {ssl_fc}

backend no_match
http-request deny deny_status 400