auth_basic "please login with user and password"; auth_basic_user_file /home/testuser/nginx/ssl/httppasswd; 1 2 可放在server里面或location里面比如: location / { auth_basic "please login with user and password"; auth_basic_user_file conf.d/passwd; autoindex on; } 1 2 3 4 5 6 重...
ngx_http_auth_basic_module 模块允许设置用户名和密码访问指定资源。 location/test{auth_basicon;auth_basic_user_file/root/.htpasswd;#绝对路径} /root/.htpasswd 的内容可以通过以下命令生成。
access_log logs/access.log main auth_basic "http auth"; auth_basic_user_file .htpasswd; set $auth $http_authorization; if ($http_proxy_authorization) { set $auth $http_proxy_authorization; } more_set_input_headers "Authorization: $auth"; proxy_connect; proxy_connect_allow 1194; proxy_con...