Running Grafana behind a reverse proxy when TLS termination occurs at the load-balancer

Configuring Grafana behind a reverse proxy with TLS termination is a common setup. To achieve this, follow these steps:

  1. Ensure that the Latest reverse proxy handles TLS termination correctly and has a valid SSL certificate for your domain.
  2. In Grafana, set the root_url to your actual domain (e.g., https://yourdomain.com) so that the redirect URL for Azure AD OAuth is correct.
  3. To handle HTTPS within the Grafana container, you can use environment variables to specify the path to your SSL certificate and key files. For example:

javascriptCopy code

GF_SERVER_CERT_FILE=/path/to/your/cert.pem
GF_SERVER_CERT_KEY=/path/to/your/key.pem
  1. Make sure the SSL certificate and key files are accessible within the Grafana container.
  2. Restart the Grafana service to apply the new configuration.

This setup should allow you to use Azure AD OAuth with Grafana behind a reverse proxy that handles TLS termination. Ensure proper permissions and file paths are set for the SSL certificate and key files.