Getting 403 Origin Not Allowed when logging in behind Azure Application Gateway while adding dashboard sources

  • What Grafana version and what operating system are you using?
    10.2.2

  • What are you trying to achieve?
    I’m trying to expose grafana dashboard with a custom domain…

  • How are you trying to achieve it?
    I’m keeping grafana dashboard behind azure app gateway

  • What happened?
    Whenever I try to add any sources or interact with anything in grafana after login its throwing 403 origin not allowed

  • What did you expect to happen?
    It should allow me to create dashboards or add data sources

  • Can you copy/paste the configuration(s) that you are having problems with?
    grafana.ini: >
    [analytics]

    check_for_updates = true

    [grafana_net]

    url = grafana.net

    [log]

    mode = console

    [paths]

    data = /var/lib/grafana/

    logs = /var/log/grafana

    plugins = /var/lib/grafana/plugins

    provisioning = /etc/grafana/provisioning

    [server]

    domain = ‘test’

    root_url= ‘test/grafana’

    serve_from_sub_path = true

    [auth.generic_oauth]

    enabled = true

    name = OAuth

    allow_sign_up = true

    client_id = grafanatests

    scopes = openid profile email grafanatests

    auth_url =
    https://test-idp/connect/authorize

    token_url =test-idp/connect/token(Its base url is proper as auth url.just removed as discussion not allowing to add more than 2 links)

    api_url = test-idp/connect/userinfo(Its base url is proper as auth url.just removed as discussion not allowing to add more than 2 links)

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    Origin not allowed 403

Your API gateway must forward proper host header, which you configured in server domain section. So check documentation of your gateway how to do that.