I am trying to protect access to M/Monit web interface:
Box:
ubuntu 14.04
nginx 1.8.1
mmonit-3.5.1
I created a mmonit config file under /etc/nginx/sites-available
:
server {
listen 8080;
root /var/www/html;
location / {
auth_basic "Restricted Content";
auth_basic_user_file /etc/nginx/.htpasswd;
}
location ~ /\.ht {
deny all;
}
}
It does not display the authentication dialog. I followed serverfault-Nginx Password Protect Entire Port Number 8081, but it seems I am getting something done wrong...I am new to nginx.
Anyone has an idea how to go about it?
Should it be in the same default
server config file?
Cheers