Quản trị net diễn đàn chia sẻ thông tin các thủ thuật mạng, internet bảo mật thông tin dành cho giới IT VIệt hy vọng là nơi bổ ích cho cộng đồng

Quản trị net diễn đàn chia sẻ thông tin các thủ thuật mạng, internet bảo mật thông tin dành cho giới IT VIệt hy vọng là nơi bổ ích cho cộng đồng (http://quantrinet.com/forum/index.php)
-   11.Xây dựng máy chủ Proxy Server - Squid (http://quantrinet.com/forum/forumdisplay.php?f=212)
-   -   File cấu hình HAproxy mẩu (http://quantrinet.com/forum/showthread.php?t=10000)

hoctinhoc 24-02-2016 04:14 PM

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


:battay:


Bây giờ là 04:45 PM. Giờ GMT +7

Diễn đàn tin học QuantriNet
quantrinet.com | quantrimang.co.cc
Founded by Trương Văn Phương | Developed by QuantriNet's members.
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.