View Single Post
Tuổi 24-02-2016, 04:14 PM   #1
hoctinhoc
Guest
 
Trả Lời: n/a
File cấu hình HAproxy mẩu
File cấu hình HAproxy mẩu

Tham khảo bài viết:http://www.server-world.info/en/note...OS_7&p=haproxy


Trích dẫn:
# create new

global


# for logging section



log 127.0.0.1 local2 info
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
# max per-process number of connections


maxconn 5000

# process' user and group


user haproxy

group haproxy

# makes the process fork into background


daemon

defaults

# running mode

mode http


# use global settings
log global


# get HTTP request log


option httplog

# timeout if backends do not reply


timeout connect 10s

# timeout on client side


timeout client 30s

# timeout on server side


timeout server 30s

# define frontend ( set any name for "http-in" section )



frontend http-in
# listen 80

bind *:80

# set default backend

default_backend backend_servers
# send X-Forwarded-For header


option forwardfor # define backend


backend backend_servers

# balance with roundrobin

balance roundrobin

# define backend servers



server www01 10.0.0.31:80 check
server www02 10.0.0.32:80 check

  Trả lời ngay kèm theo trích dẫn này