Guest User

Untitled

a guest
Jan 19th, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.93 KB | None | 0 0
  1. use_backend plex if { hdr_beg(Host) -i plex. }
  2.  
  3. backend plex
  4. server plex localhost:32400 check
  5.  
  6. reqrep ^([^ :]*) /(.*) 1 /web2
  7.  
  8. frontend http
  9. mode http
  10. bind *:80
  11.  
  12. acl plex hdr_beg(Host) -i plex.
  13. acl root_dir path_reg ^$|^/$
  14. acl no_plex_header req.hdr_cnt(X-Plex-Device-Name) -i 0
  15.  
  16. redirect location http://plex.mydomain.tld/web/index.html 301 if no_plex_header root_dir plex
  17. use_backend plex if plex
  18.  
  19. backend plex
  20. server plex localhost:32400 check
  21.  
  22. redirect location http://plex.mydomain.tld/web/index.html code 301 if no_plex_header root_dir plex
  23.  
  24. global
  25. log 127.0.0.1 syslog
  26. maxconn 1000
  27. user haproxy
  28. group haproxy
  29. daemon
  30. tune.ssl.default-dh-param 4096
  31. ssl-default-bind-options no-sslv3 no-tls-tickets
  32. ssl-default-bind-ciphers EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
  33.  
  34.  
  35. defaults
  36. log global
  37. mode http
  38. option httplog
  39. option dontlognull
  40. option http-server-close
  41. option forwardfor except 127.0.0.0/8
  42. option redispatch
  43. option contstats
  44. retries 3
  45. timeout http-request 10s
  46. timeout queue 1m
  47. timeout connect 10s
  48. timeout client 1m
  49. timeout server 1m
  50. timeout check 10s
  51.  
  52. listen stats
  53. bind *:9090
  54. mode http
  55. maxconn 10
  56. stats enable
  57. stats hide-version
  58. stats realm Haproxy Statistics
  59. stats uri /
  60. stats auth admin:admin
  61.  
  62. frontend ALL
  63. bind *:80
  64. bind *:443 ssl crt /etc/haproxy/certs/nomercy.myqnapcloud.com.pem crt /etc/haproxy/certs/nomercy.myqnapcloud.com.pem
  65. mode http
  66.  
  67. # Define path for lets encrypt
  68. acl is_letsencrypt path_beg -i /.well-known/acme-challenge/
  69. use_backend letsencrypt if is_letsencrypt
  70.  
  71. # Define hosts
  72. acl host_website hdr(host) -i nomercy.myqnapcloud.com
  73.  
  74. # Direct hosts to backend
  75. use_backend website if host_website
  76.  
  77. # Redirect port 80 to 443
  78. # But do not redirect letsencrypt since it checks port 80 and not 443
  79. redirect scheme https code 301 if !{ ssl_fc } !is_letsencrypt
  80.  
  81. backend letsencrypt
  82. server letsencrypt 127.0.0.1:8888
  83.  
  84. backend website
  85. balance roundrobin
  86. option httpchk GET /check
  87. cookie SERVERID insert indirect nocache
  88. http-check expect rstring ^UP$
  89. default-server inter 3s fall 3 rise 2
  90. server server1 192.168.2.151:8888 check
  91. server server2 192.168.2.152:8888 check
  92. server server3 192.168.2.153:8888 check
  93.  
  94.  
  95. listen plex
  96. bind *:32400 ssl crt /etc/haproxy/certs/nomercy.myqnapcloud.com.pem crt /etc/haproxy/certs/nomercy.myqnapcloud.com.pem
  97. balance roundrobin
  98. option httpchk GET /check
  99. http-check expect rstring ^UP$
  100. default-server inter 3s fall 3 rise 2
  101. server server1 192.168.2.149:32400 check port 8888
  102. server server2 192.168.2.148:32400 check port 8888
  103. server server3 192.168.2.147:32400 check port 8888
Add Comment
Please, Sign In to add comment