Access to Netdata or Webmin or anything through a reverse proxy on any configured domain

25 January 2021

Access to Netdata or Webmin or anything through a reverse proxy on any configured domain

Let's say you are using netdata or webmin or any other app that is using an alternative port to 80, and you want to secure your server a bit more, or perhaps it will be placed behind a very restrictive firewall, then you can use Nginx to forward the traffic from your regular site to the correct app by using folder names for them. So for example yoursite.com/netdata/. This is done by using thing called reverse proxy. It's very powerful and really easy to setup. The only thing you need to know is what port the app is using, and follow the examples below but just replace the name and port number. If you want to do this for netdata or webmin, you can just copy/paste what you see below.

The first part will go at the very top of your config file for your domain. Let's say you use a domain called example.com, then you need to place this in /etc/nginx/example.com.conf and make sure it goes BEFORE the server { block

upstream webmin {
    server 127.0.0.1:10000;
    keepalive 64;
}
upstream netdata {
    server 127.0.0.1:19999;
    keepalive 64;
}
virtual host config file

In the same config file we now need to jump to the server { block.Inside the server block It doesn't really matter where you paste these lines. I usually place it right below the first /location { block as shown in the screenshot below.

## NETDATA SETUP. Access it by entering /netdata at the end of your domain name. ##
        location = /netdata {
        return 301 /netdata/;
        }
        location ~ /netdata/(?<ndpath>.*) {
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_http_version 1.1;
        proxy_pass_request_headers on;
        proxy_set_header Connection "keep-alive";
        proxy_store off;
        proxy_pass http://netdata/$ndpath$is_args$args;
        gzip on;
        gzip_proxied any;
        gzip_types *;
        }
## END NETDATA SETUP ##
## WEBMIN SETUP. Access it by entering /webmin at the end of your domain name. ##
        location = /webmin {
        return 301 /webmin/;
        }
        location ~ /webmin/(?<ndpath>.*) {
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_http_version 1.1;
        proxy_pass_request_headers on;
        proxy_set_header Connection "keep-alive";
        proxy_store off;
        proxy_pass http://webmin/$ndpath$is_args$args;
        gzip on;
        gzip_proxied any;
        gzip_types *;
        }
## END WEBMIN SETUP ##

virtual host config file inside the block: server {

That's all!! Don't forget to do a nginx-t and then restart Nginx with: sudo systemctl restart nginx. Now you can open your webbrowser and type your domain name and add to the end /netdata. It should now display the netdata page.

Table of Contents

Leave a Reply

Your email address will not be published. Required fields are marked *

Similar Content

23 January 2021
Introduction to the new how-to article in the Knowledge Base.

I wrote a new guide on setting up your own live-stream server. Mostly due to your requests. I took the opportunity to simplify and shorten the guide a bit. If you follow this guide step by step, and use your brain a tiny bit, you'll be fine. This guide has so far been tested on […]

× Read More ×
19 June 2025
Choosing the live-stream host that suits your needs

Discover how to choose the right live-stream host for your organization. Compare popular platforms like DaCast, Wowza, Vimeo, Kick, ReStream and IBM.

× Read More ×
Copyright © 2025. 
All rights reserved.