Home  >  Article  >  Backend Development  >  nginx增添php basic验证

nginx增添php basic验证

WBOY
WBOYOriginal
2016-06-13 12:02:16892browse

nginx添加php basic验证
几种方式:

1.命令 http://www.centos.bz/2011/12/nginx-http-auth-basic/
 
  如果没有apache的htpasswd程序,可以使用pl程序生成:
  程序地址:http://trac.edgewall.org/export/10890/trunk/contrib/htpasswd.py
  使用方法: ./htpasswd.py -b -c pass.txt admin 123456
  pass.txt为密码文件,admin是用户名,123456是密码.

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

3.命令生成密码

  ./pw.pl password


生成好之后,在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