Tags

# global parameters
global
  # log on syslog of 127.0.0.1 udp port 514 (default) using local0 facility. 
  log 127.0.0.1 local0
  
  # maximum number of concurrent connections
  maxconn 4096
  
  # drop privileges after port binding
  #user nobody
  #group nogroup
  
  # run in daemon mode
  daemon
  
  # store pid of process in the file
  pidfile /var/run/haproxy.pid
  
  # create this socket for stats
  stats socket /var/run/socket-haproxy

# defaults section sets default parameters for all other following sections
defaults
  # use logging options defined in global
  log global
  
  # run in L7 mode
  mode http
  
  # log into httplog format
  option httplog
  
  # disable logging of null connections
  option dontlognull
  
  # VERY IMPORTANT OPTION: Analyze each request individually and evaluate acls for each request. Don't run in tunnel mode.
  option http-server-close
  
  # redispatch the request in case primary server based on session stickyness is down
  option redispatch

  # maximum inactivity time on client side. Recommended to keep it same as server timeout
  timeout client 30s
  
  # maximum time given to server to respond to a request
  timeout server 30s
  
  # maximum time to wait for a server connection to succeed. Can be as low as few msec if Haproxy and server are on same LAN
  timeout connect 1s
  
  # timeout for keep alive
  timeout http-keep-alive 60s
  
  # maximum time to wait for client to send full request. Keep it like 5s  for get DoS protection
  timeout http-request 5s

  # enable stats web interface. very helpful to see what's happening in haproxy
  stats enable
  
  # default referesh time for web interface
  stats refresh 10s
  
  # uri for the web interface
  stats uri /stats

  cookie COOKIENAME prefix

frontend ft_http
    bind :80
    mode http
    # default_backend AppServers
    redirect prefix https://cebufreelancer.com

frontend ft_https
    bind :443
    mode tcp
    default_backend bk_https
 
backend bk_https
    mode tcp
    balance roundrobin #leastconn
    server bak1 bak1.cebufreelancer.com:443 check id 1 cookie bak1
    server bak2 bak2.cebufreelancer.com:443 check id 2 cookie bak2
Advertisements