Home  >  Article  >  Backend Development  >  nginx adds php basic verification

nginx adds php basic verification

巴扎黑
巴扎黑Original
2016-11-12 14:12:231287browse

Several ways:

1. Command http://www.centos.bz/2011/12/nginx-http-auth-basic/

If there is no apache htpasswd program, you can use the pl program to generate:
Program address :http://trac.edgewall.org/export/10890/trunk/contrib/htpasswd.py
Usage: ./htpasswd.py -b -c pass.txt admin 123456
pass.txt is the password file, admin is User name, 123456 is the password.

2.apache http://jooben.blog.51cto.com/253727/429977

3. Command to generate password

./pw.pl password


After generating it, Added to nginx

#auth_basic "Please input your username and password!";
#auth_basic_user_file /usr/local/nginx/conf/engir_pass;

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