I am trying to secure the login URL of my website (Ajenti control panel) with auth_basic authentication. I access the site like this: https://myajentiinstallation.com:8787
In the file /etc/nginx.custom.d/codes.conf, I have this code:
server {
listen 8787 ssl;
ssl_certificate /etc/ssl/other/cert.crt;
ssl_certificate_key /etc/ssl/other/key.key;
location / {
auth_basic "Admin Login";
auth_basic_user_file /etc/other/htpass;
}
}
However, when I go to https://myajentiinstallation.com:8787, I am taken to Nginx's default page!
How can I secure my Ajenti login page with auth_basic authentication?
Thanks!