当前位置:首页 > 服务器技术 > nginx

nginx添加phpbasic验证

几种方式:

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;
【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!