Home > Operation and Maintenance > Nginx > Example analysis of adding account and password verification to nginx

Example analysis of adding account and password verification to nginx

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2023-06-03 09:28:22
forward
793 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 functions. You can pass the authbase account and password authentication provided by nginx. To achieve this, 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 Example analysis of adding account and password verification to 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
Latest Issues
Error restarting nginx
From 1970-01-01 08:00:00
0
0
0
server - Nginx configuration webapp problem
From 1970-01-01 08:00:00
0
0
0
Nginx default.conf problem
From 1970-01-01 08:00:00
0
0
0
centos7 - NGINX exception occurs
From 1970-01-01 08:00:00
0
0
0
nginx load balancing
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template