nginx basic 验证
?
nginx(web服务器) basic 验证(例如路由进入时要输入的 用户名:密码)- 编译的时候默认参数即可
- 执行
cd /usr/local/nginx/conf /usr/local/apache2/bin/htpasswd -c -d pass_file user_name #回车输入密码,-c 表示生成文件,-d是以 crypt 加密。 Adding password for n2. New password:Re-type new password:vim nginx.conf ### auth_basic_user_file 的相对目录是 nginx_home/confserver { listen 80; server_name xxx.com; location / { auth_basic "auth"; auth_basic_user_file pass_file; } }??
./configure --with-pcre=../pcre --with-zlib=../zlib --with-http_ssl_module --with-openssl=../openssl --with-http_sub_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_flv_module --with-debug
- 密码文件生成,需要
apt-get install mini-httpd