global
log127.0.0.1 local2
#chroot/var/lib/haproxy # 서비스 제일 경로, 슈퍼유저로 프로세스 실행 시 모든 동작은 이 안에서 수행
#pidfile/var/run/haproxy.pid # 실행피드명
#stats socket/var/run/haproxy.sock mode 666 level admin
maxconn4000
tune.ssl.default-dh-param 4000 # ssl 적용시 항목, maxconn이랑 맞추자
userroot
grouproot
daemon
defaults
modehttp # http 프로토콜 사용
logglobal # 로그는 global 설정을 따른다
option httplog # 로그 디텔일을 높임
optiondontlognull # 로그 비대화 방지를 위해 probe같은 잡다한 기록은 남기지 않음
option forwardfor
optionhttp-server-close
retries3
timeout http-request10s # 도스 방어 요청타임아웃 시간 설정
timeoutqueue1m
timeout connect20s
timeout client1m
timeout server1m
timeout http-keep-alive10s
timeout check20s
maxconn3000
# front
#frontend http_front # http 프론트엔드
#bind *:80
#http-request set-header X-Forwarded-Proto http
#default_backend default
#frontend https_front
#bind *:443 ssl crt usr/local/etc/haproxy/certs/wildcard.example.duckdns.org-fullchain.pem # 발급한 인증서 적용
해주자
#http-request set-header X-Forwarded-Proto https
# #accongbox.com으로 들어오는 요청은 host_home이라는 그룹으로 보낸다.
#acl host_home hdr(host) -i accongbox.com
# #sync.accongbox.com으로 들어오는 요청은 host_sync로 보낸다.
#acl host_sync hdr(host) -i sync.accongbox.com
# #host_home의 경우 web이라는 이름을 가진 backend를 사용
#use_backend web if host_home
# #host_sync의 경우 sync_server이라는 이름을 가진 backend 사용
#use_backend sync_server if host_sync
#이외에는 기본으로 default라는 이름을 가진 백엔드 사용
#default_backend default
frontend lolapi
bind *:443 ssl crt usr/local/etc/haproxy/certs/wildcard.example.duckdns.org-fullchain.pem
mode http
tcp-request inspect-delay 5s
default_backend lolapi
#resolvers docker # docker 컨테이너간 통신을 하기 위해 resover설정, 같은 다커 네트워크 상에 있으면 이름으로 통신 가능
#nameserver dns1 127.0.0.11:53
backend lolapi
mode http
redirect scheme https if !{ ssl_fc } # http접근인 경우 https로 리다이렉트
#balance roundrobin
option ssl-hello-chk
server server1 127.0.0.1:10002
#backend web
#redirect scheme https if !{ ssl_fc }
#balance roundrobin
#server home_server accongbox-front:5000 check resolvers docker # 포트 지정하기
#listen #프론트/밴엔드의 연결의 포트/옵션을 정의함. tcp제어나 proxy에 주로 사용
listen stats # stats란 이름으로 리슨 지정
bind *:9001 # 접속포트 지정
stats enable
stats realm Haproxy Statistics
stats uri /haproxy_stats # stat을 제공할 url
#stats auth Username:Password # 인증이 필요하면 추가한다
#listen lolapi
# bind *:443 ssl crt usr/local/etc/haproxy/certs/wildcard.example.duckdns.org-fullchain.pem
frontend proxmox
bind *:443 ssl crt usr/local/etc/haproxy/certs/wildcard.example.duckdns.org-fullchain.pem
mode tcp
#option http-server-close
option forwardfor
http-request add-header X-Forwarded-Proto https
http-request add-header X-Forwarded-Port 443
tcp-request inspect-delay 5s
http-response add-header Strict-Transport-Security max-age=15768000
default_backend proxmox
backend proxmox
mode tcp
#redirect scheme https if !{ ssl_fc } # http접근인 경우 https로 리다이렉트
#option ssl-hello-chk
#tcp-request inspect-delay 5s
#stick-table type ip size 200k expire 30m
#stick on src
#default-server inter 1s
balance roundrobin
timeout connect30000
timeout server30000
http-check disable-on-404
server server1 localhost:35000 check ssl verify none # 접속하는곳이 자체인증서 https일경우 검증x