Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

76 lines
2.2KB

  1. global
  2. maxconn 4096
  3. #tune.ssl.default-dh-param 2048
  4. defaults
  5. mode http
  6. timeout connect 5000ms
  7. timeout client 50000ms
  8. timeout server 50000ms
  9. #log global
  10. #log 127.0.0.1 local0 debug
  11. #option tcplog
  12. # https://www.haproxy.com/blog/how-to-get-ssl-with-haproxy-getting-rid-of-stunnel-stud-nginx-or-pound/
  13. frontend https-in
  14. mode http
  15. #bind *:443 ssl crt /etc/letsencrypt/haproxy/${NEXTCLOUD_URL}.pem crt /etc/letsencrypt/haproxy/${GITEA_URL}.pem
  16. bind *:443 ssl ${HAPROXY_CERTS}
  17. acl letsencrypt-acl path_beg /.well-known/acme-challenge/
  18. #acl nextcloud-acl ssl_fc_sni ${NEXTCLOUD_URL}
  19. #acl gitea-acl ssl_fc_sni ${GITEA_URL}
  20. acl nextcloud-acl ssl_fc_sni_reg ^${NEXTCLOUD_SERVER_NAME}\.
  21. acl gitea-acl ssl_fc_sni_reg ^${GITEA_SERVER_NAME}\.
  22. use_backend letsencrypt-backend if letsencrypt-acl
  23. use_backend nextcloud if nextcloud-acl
  24. use_backend gitea if gitea-acl
  25. default_backend nextcloud
  26. backend nextcloud
  27. # http://cbonte.github.io/haproxy-dconv/1.5/configuration.html#option%20http-server-close
  28. #option http-server-close
  29. #option forwardfor
  30. #redirect http to https
  31. #redirect scheme https if !{ ssl_fc }
  32. server nextcloud nextcloud:443 maxconn 32 check ssl verify none
  33. backend gitea
  34. #redirect http to https
  35. #redirect scheme https if !{ ssl_fc }
  36. server gitea gitea:2443 maxconn 32 check ssl verify none
  37. frontend http-in
  38. bind *:80
  39. acl letsencrypt-acl path_beg /.well-known/acme-challenge/
  40. #acl is_nextcloud hdr_end(host) -i ${NEXTCLOUD_URL}
  41. #acl is_gitea hdr_end(host) -i ${GITEA_URL}
  42. acl is_nextcloud hdr_reg(host) ^${NEXTCLOUD_SERVER_NAME}\.
  43. acl is_gitea hdr_reg(host) ^${GITEA_SERVER_NAME}\.
  44. use_backend letsencrypt-backend if letsencrypt-acl
  45. use_backend nextcloud-insecure if is_nextcloud
  46. use_backend gitea-insecure if is_gitea
  47. default_backend pihole-insecure
  48. backend nextcloud-insecure
  49. server nextcloud nextcloud:80 maxconn 32
  50. backend gitea-insecure
  51. server gitea gitea:2080 maxconn 32
  52. backend pihole-insecure
  53. server pihole pihole:80 maxconn 32
  54. # LE Backend
  55. backend letsencrypt-backend
  56. server letsencrypt 127.0.0.1:8888
  57. #listen admin
  58. # bind 127.0.0.1:8080
  59. # stats enable