global
  log /dev/log local0
  log /dev/log local1 notice

defaults
  log global
  mode http
  option httplog
  option dontlognull
  timeout connect 5s
  timeout client 10s
  timeout server 10s

listen stats
  bind *:71
  mode http
  stats enable
  stats uri /

frontend fox_balancer
  bind *:8090
  bind *:8091
  mode http

  acl is_fox url_port 8090
  acl is_session url_port 8091

  use_backend fox if is_fox 
  use_backend session if is_session

backend fox
  mode http
  option forwardfor
  server fox fox:8090 check
  option httpchk GET /
  http-check expect status 200

backend session
  mode http
  option forwardfor
  server session session:8091 check
  option httpchk GET /
  http-check expect status 200

global
  log /dev/log local0
  log /dev/log local1 notice

defaults
  log global
  mode http
  option httplog
  option dontlognull
  timeout connect 5s
  timeout client 10s
  timeout server 10s

listen stats
  bind *:71
  mode http
  stats enable
  stats uri /

frontend fox_balancer
  bind *:8090
  bind *:8091
  mode http

  acl is_fox path_dir /fox
  use_backend fox if is_fox 

  acl is_session path_dir /login
  use_backend session if is_session

backend fox
  mode http
  option forwardfor
  server fox fox:8090 check
  option httpchk GET /
  http-check expect status 200

backend session
  mode http
  option forwardfor
  server session session:8091 check
  option httpchk GET /
  http-check expect status 200

Use the path of the url request in haproxy ACL, because port changes
Use the path of the url request in haproxy ACL, because port changes

The request from inside static_web (see docker-compose.yml)
to fox_LB (LB stands for load balancer, see fox_LB/haproxy.cfg) goes
through a nodejs proxy that uses CORS (changeOrigin is set to true
in static/properties.sample.json). This means that the request
port is changed and we have to rely on the request's URL path to
decide which backend to send the request.

In the case of fox service, it seems that frontend balancer can
listen on 8090, but the ACL, defined inside the balancer (see the
fox_LB/haproxy.cfg), uses the new port assigned due to CORS. #33
