For security reasons, deploy web content that you do not want others to see, or to enhance security.
Deployment steps:
First use apache’s htpasswd function to generate a username and password:
htpasswd -c /usr/local/nginx/conf/test.pass test New password:123456
2. Add the following two lines in the nginx configuration file location:
location / { root /usr/share; index index.php index.html index.htm; auth_basic "Authorized users only"; auth_basic_user_file conf/test.pass; }