如何使用nginx.conf在基本授权中获取用户名/密码?

时间:2012-10-12 02:35:57

标签: nginx basic-authentication

在基本授权中是否有任何函数获取用户名/密码nginx.conf?

感谢。

2 个答案:

答案 0 :(得分:7)

您可以使用标准变量 $ remote_user ,这意味着随基本身份验证提供的用户名

http://nginx.org/en/docs/http/ngx_http_core_module.html#var_remote_user

答案 1 :(得分:2)

使用nginx第三方模块FRiCKLE/ngx_coolkit,您可以使用$remote_passwd获取密码。和nginx核心有$remote_user