Nginx file server in Windows comes with basic authentication
Configure nginx
Add the following configuration file to the nginx configuration file
server { listen 7777 default_server; listen [::]:7777 default_server; Location / {# alias D:/share; Auth_basic "nginx basic auth"; auth_basic_user_file C:/nginx/conf/htpasswd; # autoindex on; Autoindex_exact_size off; Autoindex_localtime on (KB, MB, GB); # display local time instead of GMT time}}Copy the code
Creating a User File
Create the htpasswd file in C:/nginx/conf and create users in the following order
username:password
Copy the code
reload nginx
nginx.exe -s reload
Copy the code
Enter your account and password on the website to access the file service
Welcome to my personal blog ximikang.icu