Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
152 lines (134 sloc) 6.06 KB
###############################################################################
# the following is an example for a nebula worker node HAPRoxy to route port 80
# and ssl strip port 443 traffic (both configured as HTTP) & redirect said
# traffic to 32 work containers that runs as a service on each worker node
# as a service (not inside container), this is just an example so your config
# will likely be different depending on your environment.
###############################################################################
#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
# to have these messages end up in /var/log/haproxy.log you will
# need to:
#
# 1) configure syslog to accept network log events. This is done
# by adding the '-r' option to the SYSLOGD_OPTIONS in
# /etc/sysconfig/syslog
#
# 2) configure local2 events to go to the /var/log/haproxy.log
# file. A line like the following can be added to
# /etc/sysconfig/syslog
#
# local2.* /var/log/haproxy.log
#
log 127.0.0.1 local2
nbproc 4
cpu-map 1 0
cpu-map 2 1
cpu-map 3 2
cpu-map 4 3
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 300000
user haproxy
group haproxy
daemon
# turn on stats unix socket
stats socket /var/lib/haproxy/stats
#---------------------------------------------------------------------
# common defaults that all the 'listen' and 'backend' sections will
# use if not designated in their block
#---------------------------------------------------------------------
defaults
mode http
log global
#option httplog
option dontlognull
option http-server-close
option forwardfor #except 127.0.0.0/8
option redispatch
retries 3
timeout http-request 30s
timeout queue 1m
timeout connect 10s
timeout client 30s
timeout server 30s
timeout http-keep-alive 31s
timeout check 10s
maxconn 300000
#---------------------------------------------------------------------
# HTTP frontend which proxys to the backends clusters
#---------------------------------------------------------------------
frontend main
bind *:80
mode http
#option httplog
#option httpclose
option http-server-close
acl is_nebula dst_port 80
use_backend nebula if is_nebula
default_backend nebula
#---------------------------------------------------------------------
# nebula backend for serving up our microservices
#---------------------------------------------------------------------
backend nebula
option httplog
option httpclose
option httpchk HEAD /
http-check expect status 200
option forwardfor
balance static-rr
maxconn 300000
default-server inter 5s fall 1 rise 1
server nebula-01 127.0.0.1:81 weight 30 maxconn 100 check
server nebula-02 127.0.0.1:82 weight 30 maxconn 100 check
server nebula-03 127.0.0.1:83 weight 30 maxconn 100 check
server nebula-04 127.0.0.1:84 weight 30 maxconn 100 check
server nebula-05 127.0.0.1:85 weight 30 maxconn 100 check
server nebula-06 127.0.0.1:86 weight 30 maxconn 100 check
server nebula-07 127.0.0.1:87 weight 30 maxconn 100 check
server nebula-08 127.0.0.1:88 weight 30 maxconn 100 check
server nebula-09 127.0.0.1:89 weight 30 maxconn 100 check
server nebula-10 127.0.0.1:90 weight 30 maxconn 100 check
server nebula-11 127.0.0.1:91 weight 30 maxconn 100 check
server nebula-12 127.0.0.1:92 weight 30 maxconn 100 check
server nebula-13 127.0.0.1:93 weight 30 maxconn 100 check
server nebula-14 127.0.0.1:94 weight 30 maxconn 100 check
server nebula-15 127.0.0.1:95 weight 30 maxconn 100 check
server nebula-16 127.0.0.1:96 weight 30 maxconn 100 check
server nebula-17 127.0.0.1:97 weight 30 maxconn 100 check
server nebula-18 127.0.0.1:98 weight 30 maxconn 100 check
server nebula-19 127.0.0.1:99 weight 30 maxconn 100 check
server nebula-20 127.0.0.1:100 weight 30 maxconn 100 check
server nebula-21 127.0.0.1:101 weight 30 maxconn 100 check
server nebula-22 127.0.0.1:102 weight 30 maxconn 100 check
server nebula-23 127.0.0.1:103 weight 30 maxconn 100 check
server nebula-24 127.0.0.1:104 weight 30 maxconn 100 check
server nebula-25 127.0.0.1:105 weight 30 maxconn 100 check
server nebula-26 127.0.0.1:106 weight 30 maxconn 100 check
server nebula-27 127.0.0.1:107 weight 30 maxconn 100 check
server nebula-28 127.0.0.1:108 weight 30 maxconn 100 check
server nebula-29 127.0.0.1:109 weight 30 maxconn 100 check
server nebula-30 127.0.0.1:110 weight 30 maxconn 100 check
server nebula-31 127.0.0.1:111 weight 30 maxconn 100 check
server nebula-32 127.0.0.1:112 weight 30 maxconn 100 check
#---------------------------------------------------------------------
# Statistics and Monitoring
#---------------------------------------------------------------------
# you might want to change the IP below to a private IP address to be able to reach the status page from outside the server
listen stats 127.0.0.1:8080
mode http
balance
timeout client 5000
timeout connect 4000
timeout server 5000
#This is the virtual URL to access the stats page
stats uri /haproxy_stats
#Authentication realm. This can be set to anything. Escape space characters with a backslash.
stats realm HAProxy\ Statistics
#The user/pass you want to use. Change this password!
stats auth admin:password
#This allows you to take down and bring up back end servers.
#This will produce an error on older versions of HAProxy.
stats admin if TRUE