Secure Ajenti with Web Server Authentication auth_basic

Pamela 6 years ago updated 6 years ago 5
I am trying to secure the Ajenti login URL with auth_basic authentication. I have changed the default port to 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 the Ajenti login page with auth_basic authentication?

simply you just go to you configure tab, and change the port, save the settings, restart ajenti
like me, i change the port to 7463
Thank you very much Amirhossein.

I'm sorry. I think I made myself unclear.

I have successfully changed Ajenti's port to 8787 and am able to log in fine.

However, I want to further secure things by adding auth_basic to this so that anyone going to https://myajentiinstallation.com:8787 must first enter in a username/password for auth_basic, and then after entering the correct credentials, they see the normal Ajenti login screen.

Any ideas?

Thanks again!
i realy wann help,i try hard, but i dont know any idea , so sorry
but i think you shoud use ajenti behind nginx
Thank you! I will try this again and keep seeing if I can solve it.

I know you tried helping me. I see you are helping a lot of people here in the forum. I appreciate your help!

Thanks again, and I will post here if/when I figure it out.