Skip to content


 Zabbix
 Grafana
 Prometheus
 Threejs and TypeScript
 SocketIO and TypeScript
 Blender Topological Earth
 Sweet Home 3D
 Design Patterns Python
 Design Patterns TypeScript
   
 Course Coupon Codes
Python   TypeScript
Kindle Edition Kindle Edition
$9.99 $14.99 $9.99 $14.99
Paperback Paperback
$14.99 $19.99 $14.99 $19.99








Reverse Proxy Prometheus with Nginx

Video Lecture

Reverse Proxy Prometheus with Nginx Reverse Proxy Prometheus with Nginx Reverse Proxy Prometheus with Nginx

Description

One option to help secure our Prometheus server is to put it behind a reverse proxy so that we can later add SSL and an Authentication layer over the default unrestricted Prometheus web interface.

We can use Nginx.

1
sudo apt install nginx

CD to the Nginx sites-enabled folder

1
cd /etc/nginx/sites-enabled

Create a new Nginx configuration for Prometheus

1
sudo nano prometheus

And copy/paste the example below

1
2
3
4
5
6
7
8
9
server {
    listen 80;
    listen [::]:80;
    server_name  YOUR-DOMAIN-NAME;

    location / {
        proxy_pass           http://localhost:9090/;
    }
}

Save and test the new configuration has no errors

1
nginx -t

Restart Nginx

1
2
sudo service nginx restart
sudo service nginx status

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
rm /etc/nginx/sites-enabled/default