Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

96 lines
2.9KB

  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. acl blog1-acl ssl_fc_sni_reg ^${BLOG_1_SERVER_NAME}\.
  23. acl hauk-acl ssl_fc_sni_reg ^${HAUK_SERVER_NAME}\.
  24. use_backend letsencrypt-backend if letsencrypt-acl
  25. use_backend nextcloud if nextcloud-acl
  26. use_backend gitea if gitea-acl
  27. use_backend blog1 if blog1-acl
  28. use_backend hauk if hauk-acl
  29. default_backend nextcloud
  30. backend nextcloud
  31. # http://cbonte.github.io/haproxy-dconv/1.5/configuration.html#option%20http-server-close
  32. #option http-server-close
  33. #option forwardfor
  34. #redirect http to https
  35. #redirect scheme https if !{ ssl_fc }
  36. server nextcloud nextcloud:443 maxconn 32 check ssl verify none
  37. backend gitea
  38. #redirect http to https
  39. #redirect scheme https if !{ ssl_fc }
  40. server gitea gitea:2443 maxconn 32 check ssl verify none
  41. backend blog1
  42. # https://forum.ghost.org/t/cant-get-full-site-ssl/12478/6
  43. # https://blog.woodenstake.se/starting-a-blog-again/
  44. option forwardfor
  45. http-request set-header X-Forwarded-Port %[dst_port]
  46. http-request add-header X-Forwarded-Proto https if { ssl_fc }
  47. server blog1 blog1:2368 maxconn 32
  48. backend hauk
  49. server hauk hauk:80 maxconn 32
  50. frontend http-in
  51. bind *:80
  52. acl letsencrypt-acl path_beg /.well-known/acme-challenge/
  53. #acl is_nextcloud hdr_end(host) -i ${NEXTCLOUD_URL}
  54. #acl is_gitea hdr_end(host) -i ${GITEA_URL}
  55. acl is_nextcloud hdr_reg(host) ^${NEXTCLOUD_SERVER_NAME}\.
  56. acl is_gitea hdr_reg(host) ^${GITEA_SERVER_NAME}\.
  57. acl is_hauk hdr_reg(host) ^${HAUK_SERVER_NAME}\.
  58. use_backend letsencrypt-backend if letsencrypt-acl
  59. use_backend nextcloud-insecure if is_nextcloud
  60. use_backend gitea-insecure if is_gitea
  61. use_backend hauk-insecure if is_hauk
  62. default_backend pihole-insecure
  63. backend nextcloud-insecure
  64. server nextcloud nextcloud:80 maxconn 32
  65. backend gitea-insecure
  66. server gitea gitea:3000 maxconn 32
  67. backend hauk-insecure
  68. server hauk hauk:80 maxconn 32
  69. backend pihole-insecure
  70. server pihole pihole:80 maxconn 32
  71. # LE Backend
  72. backend letsencrypt-backend
  73. server letsencrypt 127.0.0.1:8888
  74. #listen admin
  75. # bind 127.0.0.1:8080
  76. # stats enable