Can the info page that has password protection?

now, anyone can visit the info page! I was trying to add password in the Nginx config file but it is not successful. It is getting 404 after I entered the user and password. The following is my config block for the info page:

location ~^/info {
    auth_basic          "Restricted and Password Protected Page";
    auth_basic_user_file /etc/nginx/ht-passwd/.htpasswd;
}

Does anyone know why there is showing 404?

Hello @anguschang

Answered you in PM.
UPD: problem is solved.