Skip to content

Reverse Proxy Prometheus with Nginx

Video Lecture

Reverse Proxy Prometheus with Nginx Reverse Proxy Prometheus with Nginx

 (Pay Per View)

You can use PayPal to purchase a one time viewing of this video for $1.49 USD.

Pay Per View Terms

  • One viewing session of this video will cost the equivalent of $1.49 USD in your currency.
  • After successful purchase, the video will automatically start playing.
  • You can pause, replay and go fullscreen as many times as needed in one single session for up to an hour.
  • Do not refresh the browser since it will invalidate the session.
  • If you want longer-term access to all videos, consider purchasing full access through Udemy or YouTube Memberships instead.
  • This Pay Per View option does not permit downloading this video for later viewing or sharing.
  • All videos are Copyright © 2019-2025 Sean Bradley, all rights reserved.

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.

sudo apt install nginx

CD to the Nginx sites-enabled folder

cd /etc/nginx/sites-enabled

Create a new Nginx configuration for Prometheus

sudo nano prometheus

And copy/paste the example below

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

nginx -t

Restart Nginx

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 its configuration using the command below.

rm /etc/nginx/sites-enabled/default

Prometheus 2.31 and Ubuntu 22.04 Notes

There are no considerable differences to be aware of as shown and discussed in the video in case you decide to install Prometheus 2.31.2 on Ubuntu 22.04 LTS.