Install Grafana Behind reverse proxy
Last updated
Was this helpful?
Last updated
Was this helpful?
If the installation is done on a Host server then the following steps should be performed to setup grafana behind a reverse proxy.
To let Grafana know how to render and redirect the links correctly, in the Grafana configuration file, change server.domain
to the domain name that will be used,
2. Restart grafana to see the changes
3. To serve grafana behind the sub path, such as
Include the sub path at the end of the root_url.
Set serve_from_sub_path
to true.
4. Next step is to configure NGINX.
NGINX is a high performance load balancer, web server, and reverse proxy.
In the NGINX configuration file inside http
section, add the following:
Reload the NGINX configuration
Navigate to port 80 on the machine NGINX is running on and the Grafana login page will appear.
To configure NGINX to serve Grafana under a sub path, update the location
block:
To configure HAProxy to serve Grafana under a sub path:
IIS requires that the URL Rewrite module is installed.
To configure IIS to serve Grafana under a sub path, create an Inbound Rule for the parent website in IIS Manager with the following settings:
pattern: grafana(/)?(.*)
check the Ignore case
checkbox
rewrite URL set to http://localhost:3000/{R:2}
check the Append query string
checkbox
check the Stop processing of subsequent rules
checkbox
This is the rewrite rule that is generated in the web.config
:
Using the docker provider the following labels will configure the router and service for a domain or subdomain routing.
To deploy a subpath
Examples using the file provider,
For Grafana Live which uses WebSocket connections, raise a Nginx option which is 512 by default – which limits the number of possible concurrent connections with Grafana Live.
Also, be aware that the above configuration will work only when the proxy_pass
value for location /
is a literal string. If you are using a variable here, and there will be a need to add .
Check the for more in-depth instructions.
Cloud Native Reverse Proxy / Load Balancer / Edge Router