Get the App
SLTechnology News&Howtos  ›  Servers  › 

Ngin web configuration password

Shulou Source: shulou.com Published: 2022-06-02 16:21:11 09月22日 Update

1, first edit the nginx.conf configuration file to create (marked in red) server { listen 80; server_name xxxxx; location / { root html; index index.html index.htm; }2. Generate the username and corresponding password file by htpasswd command. mkdir /usr/local/nginxhtpasswd -c /usr/local/nginx/passwd admin ####Create authentication information, admin is authentication username New password: ***** ####Enter authentication password Re-type new password: ****** Add password for user admin cat /usr/local/nginx/passwd ####You can see that the password generated by htpasswd is encrypted format 3. Restart nginxnginx -s reload.

Tags: Password authentication file user user name generation input configuration information again command format part encryption Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Shulou Technology Docker NVidia Shulou Information