yaoweibin / nginx_tcp_proxy_module

add the feature of tcp proxy with nginx, with health check and status monitor
http://yaoweibin.github.com/nginx_tcp_proxy_module
1.64k stars 366 forks source link

是否支持auth_basic验证? #149

Open xrff opened 7 years ago

xrff commented 7 years ago

我尝试了一下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验证?

777clearlove commented 4 years ago

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