title: How would I secure /netdata, or Netdata for Laravel?
body: <p>I'm following <a href="https://medium.com/@nathobson/monitoring-server-resources-on-laravel-forge-with-netdata-140aa7d9bf28" rel="nofollow noreferrer">the following guide for installing Netdata on Laravel Forge</a>. Basically, it's opening the port 1999 used for Netdata and redirecting it to <code>/netdata</code> directory.</p>
  <pre><code>location = /netdata {
    return 301 /netdata/;
  }
  
  location ~ /netdata/(?&lt;ndpath&gt;.*) {
    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 &quot;keep-alive&quot;;
    proxy_store off;
    proxy_pass http://netdata/$ndpath$is_args$args;
  
    gzip on;
    gzip_proxied any;
    gzip_types *;
  }
  </code></pre>
  <pre><code>upstream netdata {
    server 127.0.0.1:19999;
    keepalive 64;
  }
  </code></pre>
  <p>I already have an <code>auth</code> middleware defined, and how would I only allow people that pass the <code>auth</code> middleware to visit the <code>/netdata</code> route? The guide suggests only limiting it to one IP address, but that's not possible as I move around quite a bit.</p>