source: packages/net/haproxy/files/haproxy.cfg @ 18880

Last change on this file since 18880 was 18880, checked in by jow, 6 years ago

[packages] add HAProxy, a high performance HTTP/TCP reverse proxy and load balancer - thanks Thomas Heil <heil@…>

File size: 2.4 KB
Line 
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
7global
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
42listen 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
66listen my_smtp_proxy
67
68        # Disable this instance without commenting out the section.
69        disable
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        server server01 192.168.1.10:123 source 192.168.1.1:25
81        server server02 192.168.1.20:123 source 192.168.1.1:25
82       
83
84# Special health check listener for integration with external load
85# balancers.
86listen local_health_check
87
88        # Listen on port 60000
89        bind :60000
90
91        # This is a health check
92        mode health
93
94        # Enable HTTP-style responses: "HTTP/1.0 200 OK"
95        # else just print "OK".
96        #option httpchk
Note: See TracBrowser for help on using the repository browser.