-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhaproxy.cfg
39 lines (33 loc) · 1.3 KB
/
haproxy.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#global section - Parameters for the entire load balancing process (OS specific)
# maxconn - Sets the maximum per-process number of concurrent connections to <number>. Proxies will stop accepting connections when this limit is reached.
global
maxconn 500
# Proxies section - Parameters for proxying incoming traffic to our backend cluster
# > defaults- optional parameters for all proxies
defaults
mode http
timeout connect 10s
timeout client 50s
timeout server 50s
# > frontend- how to handle incoming traffic
frontend http-in
bind *:3000 # The network socket adress to which client will make an HTTP request to it.
default_backend application_nodes
# > backend- servers to proxy the incoming traffic
# TODO:-
# Add "server <server_number or any name> <IP-Address of server with port number>"
# Below sample server is added with port 8030 and 8031.
# Add all the server configurations with port numbers which you have spin up.
backend application_nodes
balance roundrobin # A load balancing strategy to serve client in round robin fashion.
server server01 172.17.0.2:8031 weight 2 check
server server02 172.17.0.3:8032 check
#HERE
# .
# .
# N
#> listen- combine both backend and frontend (Optional)
frontend stats
bind *:8404
stats enable
stats uri /