[packages] haproxy: add transparent mode, needed for SNAT-TPROXY-Load-Balancing which...
[packages.git] / net / haproxy / files / haproxy.cfg
1 # Example configuration file for HAProxy 1.3, refer to the url below for
2 # a full documentation and examples for configuration:
3 # http://haproxy.1wt.eu/download/1.3/doc/configuration.txt
4
5
6 # Global parameters
7 global
8
9         # Log events to a remote syslog server at given address using the
10         # specified facility and verbosity level. Multiple log options 
11         # are allowed.
12         #log 10.0.0.1 daemon info
13
14         # Specifiy the maximum number of allowed connections.
15         maxconn 32000
16
17         # Raise the ulimit for the maximum allowed number of open socket
18         # descriptors per process. This is usually at least twice the
19         # number of allowed connections (maxconn * 2 + nb_servers + 1) .
20         ulimit-n 65535
21
22         # Drop privileges (setuid, setgid), default is "root" on OpenWrt.
23         uid 0
24         gid 0
25
26         # Perform chroot into the specified directory.
27         #chroot /var/run/haproxy/
28
29         # Daemonize on startup
30         daemon
31
32         # Enable debugging
33         #debug
34
35         # Spawn given number of processes and distribute load among them,
36         # used for multi-core environments or to circumvent per-process
37         # limits like number of open file descriptors. Default is 1.
38         #nbproc 2
39
40
41 # Example HTTP proxy listener
42 listen my_http_proxy
43
44         # Bind to port 80 and 443 on all interfaces (0.0.0.0)
45         bind :80,:443
46
47         # We're proxying HTTP here...
48         mode http
49
50         # Simple HTTP round robin over two servers using the specified
51         # source ip 192.168.1.1 .
52         balance roundrobin
53         server server01 192.168.1.10:80 source 192.168.1.1
54         server server02 192.168.1.20:80 source 192.168.1.1
55
56         # Serve an internal statistics page on /stats:
57         stats enable
58         stats uri /stats
59
60         # Enable HTTP basic auth for the statistics:
61         stats realm HA_Stats
62         stats auth username:password
63
64
65 # Example SMTP proxy listener
66 listen my_smtp_proxy
67
68         # Disable this instance without commenting out the section.
69         disabled
70
71         # Bind to port 25 and 587 on localhost
72         bind 127.0.0.1:25,127.0.0.1:587
73
74         # This is a TCP proxy
75         mode tcp
76
77         # Round robin load balancing over two servers on port 123 forcing
78         # the address 192.168.1.1 and port 25 as source.
79         balance roundrobin
80   #use next line for transparent proxy, so the servers can see the 
81   #original ip-address and remove source keyword in server definition
82   #source 0.0.0.0 usesrc clientip
83         server server01 192.168.1.10:123 source 192.168.1.1:25
84         server server02 192.168.1.20:123 source 192.168.1.1:25
85         
86
87 # Special health check listener for integration with external load
88 # balancers.
89 listen local_health_check
90
91         # Listen on port 60000
92         bind :60000
93
94         # This is a health check
95         mode health
96
97         # Enable HTTP-style responses: "HTTP/1.0 200 OK"
98         # else just print "OK".
99         #option httpchk