markdown 为用户列表配置HAProxy

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 为用户列表配置HAProxy相关的知识,希望对你有一定的参考价值。

Create SHA512 passwords

```shell
# make sure to use a leading space so that the command is not stored in your bash history!!
 mkpasswd -m sha-512 password1
# generates -> $6$yMgsow58.g/Z$mBjHfdVzqcF/LN.iwV23Eyqg.yGPTsp9pOwaStsJ6c4I4zL7BhucVVAkv5guf7OVRr8Pw0mHF4NrWBRCG5ci7/
 mkpasswd -m sha-512 password2
# generates -> $6$RZ86vRkQ$aRKN1HOsk6bDHBbMhS7jSo/p1NGFl4PvwY3KpU.72i./LvITi41nL84EkxOFXl.6Bmhynj/L7pYbfF0rUHtOB0
```

Edit /etc/haproxy/haproxy.cfg

```
userlist UsersFor_Ops
  group AdminGroup users userone,usertwo
  user userone password $6$yMgsow58.g/Z$mBjHfdVzqcF/LN.iwV23Eyqg.yGPTsp9pOwaStsJ6c4I4zL7BhucVVAkv5guf7OVRr8Pw0mHF4NrWBRCG5ci7/
  user usertwo password $6$RZ86vRkQ$aRKN1HOsk6bDHBbMhS7jSo/p1NGFl4PvwY3KpU.72i./LvITi41nL84EkxOFXl.6Bmhynj/L7pYbfF0rUHtOB0


...


backend myserver
    mode    http
    server  myserver   1.1.1.1:80
    acl AuthOkay_Ops http_auth(UsersFor_Ops)
    http-request auth realm MyAuthRealm if !AuthOkay_Ops
```

以上是关于markdown 为用户列表配置HAProxy的主要内容,如果未能解决你的问题,请参考以下文章

markdown HAProxy - 将http重定向到https

修改haproxy配置文件

Haproxy配置支持https获取用户IP地址

PYTHON学习第一模块 Haproxy配置操作

centos7配置haproxy

Linux运维:基于虚拟主机的HAProxy负载均衡系统配置实例