Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux Haproxy用户列表和允许无密码ip_Linux_Haproxy - Fatal编程技术网

Linux Haproxy用户列表和允许无密码ip

Linux Haproxy用户列表和允许无密码ip,linux,haproxy,Linux,Haproxy,如何添加在使用用户列表时未要求密码的haproxy ip地址 userlist user user user insecure-password password allow ip 1.1.1.1 [example] 类似于apache中的auth basic AuthType Basic AuthUserFile /www/.site_htpasswd AuthName "xxx" require valid-user Allow from 1.2.3

如何添加在使用用户列表时未要求密码的haproxy ip地址

userlist user
        user user insecure-password password
        allow ip 1.1.1.1 [example]
类似于apache中的auth basic

AuthType Basic 
AuthUserFile /www/.site_htpasswd 
AuthName "xxx" 
require valid-user 
Allow from 1.2.3.4

您需要使用haproxy ACL:

frontend example-frontend
     acl ip_whitelist src 1.1.1.1
     acl auth_ok http_auth(user)
     # require authentication when not in whitelist and not authenticated
     http-request auth if !ip_whitelist !auth_ok

您需要使用haproxy ACL:

frontend example-frontend
     acl ip_whitelist src 1.1.1.1
     acl auth_ok http_auth(user)
     # require authentication when not in whitelist and not authenticated
     http-request auth if !ip_whitelist !auth_ok