Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use_backend plex if { hdr_beg(Host) -i plex. }
- backend plex
- server plex localhost:32400 check
- reqrep ^([^ :]*) /(.*) 1 /web2
- frontend http
- mode http
- bind *:80
- acl plex hdr_beg(Host) -i plex.
- acl root_dir path_reg ^$|^/$
- acl no_plex_header req.hdr_cnt(X-Plex-Device-Name) -i 0
- redirect location http://plex.mydomain.tld/web/index.html 301 if no_plex_header root_dir plex
- use_backend plex if plex
- backend plex
- server plex localhost:32400 check
- redirect location http://plex.mydomain.tld/web/index.html code 301 if no_plex_header root_dir plex
- global
- log 127.0.0.1 syslog
- maxconn 1000
- user haproxy
- group haproxy
- daemon
- tune.ssl.default-dh-param 4096
- ssl-default-bind-options no-sslv3 no-tls-tickets
- ssl-default-bind-ciphers EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
- defaults
- log global
- mode http
- option httplog
- option dontlognull
- option http-server-close
- option forwardfor except 127.0.0.0/8
- option redispatch
- option contstats
- retries 3
- timeout http-request 10s
- timeout queue 1m
- timeout connect 10s
- timeout client 1m
- timeout server 1m
- timeout check 10s
- listen stats
- bind *:9090
- mode http
- maxconn 10
- stats enable
- stats hide-version
- stats realm Haproxy Statistics
- stats uri /
- stats auth admin:admin
- frontend ALL
- bind *:80
- bind *:443 ssl crt /etc/haproxy/certs/nomercy.myqnapcloud.com.pem crt /etc/haproxy/certs/nomercy.myqnapcloud.com.pem
- mode http
- # Define path for lets encrypt
- acl is_letsencrypt path_beg -i /.well-known/acme-challenge/
- use_backend letsencrypt if is_letsencrypt
- # Define hosts
- acl host_website hdr(host) -i nomercy.myqnapcloud.com
- # Direct hosts to backend
- use_backend website if host_website
- # Redirect port 80 to 443
- # But do not redirect letsencrypt since it checks port 80 and not 443
- redirect scheme https code 301 if !{ ssl_fc } !is_letsencrypt
- backend letsencrypt
- server letsencrypt 127.0.0.1:8888
- backend website
- balance roundrobin
- option httpchk GET /check
- cookie SERVERID insert indirect nocache
- http-check expect rstring ^UP$
- default-server inter 3s fall 3 rise 2
- server server1 192.168.2.151:8888 check
- server server2 192.168.2.152:8888 check
- server server3 192.168.2.153:8888 check
- listen plex
- bind *:32400 ssl crt /etc/haproxy/certs/nomercy.myqnapcloud.com.pem crt /etc/haproxy/certs/nomercy.myqnapcloud.com.pem
- balance roundrobin
- option httpchk GET /check
- http-check expect rstring ^UP$
- default-server inter 3s fall 3 rise 2
- server server1 192.168.2.149:32400 check port 8888
- server server2 192.168.2.148:32400 check port 8888
- server server3 192.168.2.147:32400 check port 8888
Add Comment
Please, Sign In to add comment