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.