Nginx Basic Auth login authentication configures

V Records 1,261 Views No comment

Sometimes we build a file server through nginx, which is generally open, but we hope that the server will not let others see it. Someone may set up a login system, but it is too troublesome, or maybe it is not necessary. The simple way is to configure Basic Auth login authentication.

1. Make sure you have httpd-tools installed

2. Create an authorized user and password

This configuration file storage path can be customized, here I point to the nginx configuration file directory, the “nginxer” is the username that is allowed to log in, the username can be customized too.

3. Configure Nginx

the auth_basic and auth_basic_user_file are certified configurations, please note that the path to the password file must be generated above (step 2).

4.Use Basic Auth login authentication

#Use in the browser
Enter the url in the browser, the user password input box will be popup.


This article was first published by V on 2018-10-04 and can be reprinted with permission, but please be sure to indicate the original link address of the article :http://www.nginxer.com/records/nginx-basic-auth-login-authentication-configures/

Leave a Reply

Your email address will not be published. Required fields are marked *

Go