Reverse Proxy Grafana with Nginx
Video Lecture
Description
Now to add a proxy. I will use Nginx. The Nginx proxy will also allow us to more easily configure our Grafana servers public address and bind an SSL certificate to it. It is possible to change the grafana.ini settings to use a specific port number, SSL certificates and http protocol instead but you will also need to manage file permissions that the Grafana server process will need. It is more versatile to use a dedicated proxy and especially if your server will be hosting multiple web applications.
Check if Nginx is installed
1 |
|
No, then install it with
1 |
|
Now check its version
1 |
|
Now check it's status
1 |
|
Visit http://[your ip address]
You should get the default Nginx web server index.html.
CD to the Nginx sites-enabled folder
1 |
|
Create a new Nginx configuration for Grafana
1 |
|
And copy/paste the example below, changing YOUR-DOMAIN-NAME to your actual domain name you've set up. Mine was grafana.sbcode.net.
1 2 3 4 5 6 7 8 9 |
|
Save and restart Nginx
1 2 |
|
Test it by visiting again
http://YOUR-DOMAIN-NAME
Visiting your ip address directly will still show the default Nginx welcome page. If you don't want this to happen, then you can delete it's configuration using the command below.
1 |
|