global
    stats socket /var/run/haproxy/admin.sock mode 660 level admin
    log stdout local0


frontend cleartext_frontend
    bind 0.0.0.0:8080

    timeout client 10s

    stats enable
    stats uri /stats
    stats refresh 30s

    log global
    option httplog
    option dontlognull
    log-format "[%t] %ci:%cp -> BACKEND:%b/%s | %HM %HU | Status:%ST | Bytes:%B"
    mode http

    use_backend be_olivetin if { hdr(Host) -i -m beg olivetin.example.com }

backend be_olivetin
    mode http
    timeout connect 10s
    timeout server 10s
    timeout tunnel 1h
    option http-server-close
    http-request set-header X-Forwarded-User "Alice"
    http-request set-header X-Forwarded-Group "Group1,Group2"
    server olivetinServer 127.0.0.1:1337 check

