Moogsoft Docs

Configure Grafana Base URL

You can configure Grafana to use a base URL path instead of an open port.

By default, Grafana uses a given an IP address to bind to and port 3000 for HTTP. If you use proxies or firewalls that block port 3000, you can configure Moogsoft AIOps to use a custom base URL for Grafana using an Nginx reverse proxy. See the Nginx documentation for more information on Nginx reverse proxies.

Configure Nginx

Before you can add a custom base URL for Grafana, ensure you have set up an Nginx reverse proxy:

  1. Open the Nginx SSL configuration file: $MOOGSOFT_HOME/common/config/nginx/moog-ssl.conf

  2. If you have Grafana installed on the same machine as Moogsoft AIOps, check the section relating to Grafana. The default sub-path is /grafana/. You can change this to meet your requirements:

    location /grafana/ {
    proxy_pass http://localhost:3000/;
    }

    If you are using GrafanaCloud, go to the same section and change localhost to your Grafana domain name:

    location /grafana/ {
    proxy_pass http://<your_domain_name>:3000/;
    }
  3. Save your changes and restart Nginx.

After completing these steps, you can configure a new base URL for Grafana.

Add the Base URL in Grafana

To add the new base URL in Grafana:

  1. Edit the Grafana configuration file: /etc/grafana/grafana.ini.

  2. Modify the domain and root_url properties as follows:

    • Delete the semi-colons to uncomment.

    • Update the values to reflect your new domain and base URL:

      domain = <your_domain_name>
      root_url = %(protocol)s://%(domain)s:/grafana

      If you are using GrafanaCloud, you only need to change the domain to your Grafana domain name.

  3. Save the changes and restart the Grafana server.

After you have completed these steps, you can access Grafana at the new base URL.