<commit_before>global
  log 127.0.0.1 local0
  log 127.0.0.1 local1 notice
  chroot /var/lib/haproxy
  user haproxy
  group haproxy
  # daemon

defaults
  log global
  mode http
  option httplog
  option dontlognull
  timeout connect 5000ms
  timeout client 50000ms
  timeout server 50000ms
  errorfile 400 /etc/haproxy/errors/400.http
  errorfile 403 /etc/haproxy/errors/403.http
  errorfile 408 /etc/haproxy/errors/408.http
  errorfile 500 /etc/haproxy/errors/500.http
  errorfile 502 /etc/haproxy/errors/502.http
  errorfile 503 /etc/haproxy/errors/503.http
  errorfile 504 /etc/haproxy/errors/504.http

listen stats :80
  stats enable
  stats uri /
<commit_msg>Example Reverse Proxy and Load Balancing<commit_after>global
  log 127.0.0.1 local0
  log 127.0.0.1 local1 notice
  chroot /var/lib/haproxy
  user haproxy
  group haproxy
  # daemon

defaults
  log global
  mode http
  option httplog
  option dontlognull
  timeout connect 5000ms
  timeout client 50000ms
  timeout server 50000ms
  errorfile 400 /etc/haproxy/errors/400.http
  errorfile 403 /etc/haproxy/errors/403.http
  errorfile 408 /etc/haproxy/errors/408.http
  errorfile 500 /etc/haproxy/errors/500.http
  errorfile 502 /etc/haproxy/errors/502.http
  errorfile 503 /etc/haproxy/errors/503.http
  errorfile 504 /etc/haproxy/errors/504.http

frontend http-in
    bind *:80
    acl is_site1 hdr_end(host) -i domain1.se
    acl is_site2 hdr_end(host) -i domain2.com
    acl is_site3 hdr_end(host) -i domain3.com

    use_backend site1 if is_site1
    use_backend site2 if is_site2
    use_backend site3 if is_site3

    default_backend site1

backend site1
    balance roundrobin
    option httpclose
    option forwardfor
    server s1 127.0.0.1:8888 maxconn 32

backend site2
    balance roundrobin
    option httpclose
    option forwardfor
    option httpchk HEAD / HTTP/1.1\r\nHost:localhost
    server s2 192.168.146.128:8888 maxconn 32 check
    server s2-1 192.168.146.128:8889 maxconn 32 check
    server s2-2 192.168.146.128:8890 maxconn 32 check

backend site3
    balance roundrobin
    option httpclose
    option forwardfor
    server s3 127.0.0.1:8080 maxconn 32

listen admin
    bind 127.0.0.1:8080
    stats enable

listen stats :8888
    stats enable
    stats uri /

{'fraction_non_alphanumeric': 0.06524633821571238, 'fraction_numerical': 0.11584553928095873, 'mean_word_length': 3.0759493670886076, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 10, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1112307', 'n_tokens_mistral': 1002, 'n_tokens_neox': 819, 'n_words': 222}