How to add account and password verification in nginx

WBOY
Release: 2023-05-22 19:46:04
forward
1668 people have browsed it

nginx adds account and password verification

server {     location / {         auth_basic "please input user&passwd";         auth_basic_user_file key/auth.key;     } }
Copy after login

There are many services accessed through nginx, but they do not provide account authentication. This can be achieved through the authbase account and password authentication provided by nginx. You can use the following script to generate the account password

# cat pwd.pl  #!/usr/bin/perl use strict;  my $pw=$ARGV[0] ; print crypt($pw,$pw)."\n";
Copy after login

Usage:

# perl pwd.pl ops-coffee.cn opf8BImqCAXww # echo "admin:opf8BImqCAXww" > key/auth.key
Copy after login

The above is the detailed content of How to add account and password verification in nginx. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template