nginx adds php basic verification

巴扎黑
Release: 2016-11-12 14:12:23
Original
1320 people have browsed it

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;

Related labels:
php
source:php.cn
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!