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 sets username and password

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

Share

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

Yum-y install nginx

Nginx partial profile

Server {listen 80 default_server; listen [:]: 80 default_server; server_name _; root / usr/share/nginx/html; # Load configuration files for the default server block. Include / etc/nginx/default.d/*.conf; location / {auth_basic "elk"; auth_basic_user_file / etc/nginx/htpasswd;} error_page 404 / 404.html; location = / 40x.html {} error_page 500 502 503 504 / 50x.html Location = / 50x.html {}} [root@l2tp html] # htpasswd-cb / etc/nginx/htpasswd liuhx 123456Adding password for user liuhx [root@l2tp html] # cat / etc/nginx/htpasswd liuhx:$apr1 $qoRxZ3ly$0PTCsKkfyujESjb8Twdj9/ [root@l2tp html] # echo "test encryption" > / usr/share/nginx/html/index.html [root@l2tp html] # nginx-tnginx

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: 203

*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