1

I have a daemon process that polls a page to monitor system status, as long as everything is happy magic_check.html will exist. As soon as something goes down the file is deleted.

I have the AWS ELB configured to check this URI and it works well, the problem I'm having is I don't want external users to access it. I did some reading and tried adding a check to just look for the existence of the x-forwarded-for header when the ELB sets it, unfortunately this is not working.

  location /magic_check.html {
    access_log off;
    if ($http_x_forwarded_for) {
        return 444;
    }
    allow 192.168.0.0/16;
    allow 127.0.0.1;
    deny all;

  }

What am I missing?

Edit: There's a few other pages that I'm masking such as nginx_status and the upstream status, they're currently blocking the elb by IP.

2
  • Who cares if external users access it? You didn't put all your passwords and bank account details in that file? Sep 22, 2014 at 12:07
  • That's a good point, There are some other use cases where this is needed though. There are other pages on there which need this such as the upstream health status and exposing that page would expose the ip addresses of upstream servers. Right now I'm denying the elb by IP but it gets messy when we start doing pipeline work.
    – Ashex
    Sep 22, 2014 at 13:51

0

You must log in to answer this question.