Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Nginx enables authentication

2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

1. Install httpdyum-y install httpd

two。 View the help command htpasswd-- help

3. Create user and password syntax: htpasswd-bcm directory username password example: htpasswd-bcm / var/user dy 123456

4. View the generated username and password cat / var/user

5. Modify the nginx.conf configuration file to add the following configuration to location # when auth_basic is off, auth_basic "hello" is turned off; auth_basic_user_file / var/user

6. Restart the nginx service service nginx reload

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report