nginx_tcp_proxy_module icon indicating copy to clipboard operation
nginx_tcp_proxy_module copied to clipboard

是否支持auth_basic验证?

Open xrff opened this issue 9 years ago • 1 comments

我尝试了一下nginx会报错:nginx: [emerg] "auth_basic" directive is not allowed here in /root/nginx/conf/nginx.conf:30

配置是这样的

tcp { upstream ha { server 192.168.164.245:2255; }

server {
listen 2255;
proxy_pass ha;

auth_basic "login test";
auth_basic_user_file conf/htpasswd;

}

}

请问是配置有问题吗还是tcp模块不支持auth_basic验证?

xrff avatar Nov 30 '16 08:11 xrff

应该是不支持,我今天也用到了,会报错。auth_basic是在ngx_http_auth_basic_module定义的,但这个项目中没有类似的模块

777clearlove avatar Aug 09 '19 07:08 777clearlove