global
log /dev/log local0
log /dev/log local1 notice
log /dev/log local1 debug
stats socket /var/lib/haproxy/stats user haproxy group haproxy mode 660 level admin #fast socket file for work haproxy stats
stats socket ipv4@127.0.0.1:9999 level admin # for work a runtime api
stats timeout 30s
chroot /var/lib/haproxy
pidfile /run/haproxy.pid
user haproxy
group haproxy
daemon
maxconn 6000
nbthread 2
ssl-default-bind-ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256
ssl-default-bind-options ssl-min-ver TLSv1.2 no-tls-tickets
ssl-dh-param-file /etc/ssl/dsh2048.pem
defaults http_defaults #this section for http L7
log global
mode http
option httplog
option dontlognull
timeout connect 4s
timeout client 30s
timeout server 4s
timeout queue 10s
timeout client-fin 30s
timeout tunnel 1h
# timeout http-request 6s
option http-buffer-request
# timeout http-keep-alive 20s
retries 3
maxconn 6000
errorfile 400 /etc/haproxy/error_pages/400.http
errorfile 403 /etc/haproxy/error_pages/403.http
errorfile 408 /etc/haproxy/error_pages/408.http
errorfile 500 /etc/haproxy/error_pages/500.http
errorfile 502 /etc/haproxy/error_pages/502.http
errorfile 503 /etc/haproxy/error_pages/503.http
errorfile 504 /etc/haproxy/error_pages/504.http
# option http-server-close
# retry-on empty-response conn-failure response-timeout
option forwardfor
frontend per_ip_rates from http_defaults
bind *:80
bind *:443 ssl crt /etc/ssl/certs/haproxy
mode http
http-request redirect scheme https unless { ssl_fc }
acl ACL_example.com hdr(host) -i example.com www.example.com
use_backend example.com if ACL_example.com
backend example.com from http_defaults
server s2 192.168.1.140:8080