Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

104 lines
3.4KB

  1. global
  2. maxconn 4096
  3. # https://stackoverflow.com/a/50480260
  4. # https://serverfault.com/a/984667
  5. hard-stop-after 600s
  6. #tune.ssl.default-dh-param 2048
  7. defaults
  8. mode http
  9. timeout connect 5000ms
  10. timeout client 50000ms
  11. timeout server 50000ms
  12. #log global
  13. #log 127.0.0.1 local0 debug
  14. #option tcplog
  15. # https://www.haproxy.com/blog/how-to-get-ssl-with-haproxy-getting-rid-of-stunnel-stud-nginx-or-pound/
  16. frontend https-in
  17. mode http
  18. #bind *:443 ssl crt /etc/letsencrypt/haproxy/${NEXTCLOUD_URL}.pem crt /etc/letsencrypt/haproxy/${GITEA_URL}.pem
  19. bind *:443 ssl ${HAPROXY_CERTS}
  20. acl letsencrypt-acl path_beg /.well-known/acme-challenge/
  21. #acl nextcloud-acl ssl_fc_sni ${NEXTCLOUD_URL}
  22. #acl gitea-acl ssl_fc_sni ${GITEA_URL}
  23. acl nextcloud-acl ssl_fc_sni_reg ^${NEXTCLOUD_SERVER_NAME}\.
  24. acl gitea-acl ssl_fc_sni_reg ^${GITEA_SERVER_NAME}\.
  25. #acl blog1-acl ssl_fc_sni_reg ^${BLOG_1_SERVER_NAME}\.
  26. acl hauk-acl ssl_fc_sni_reg ^${HAUK_SERVER_NAME}\.
  27. use_backend letsencrypt-backend if letsencrypt-acl
  28. use_backend nextcloud if nextcloud-acl
  29. use_backend gitea if gitea-acl
  30. #use_backend blog1 if blog1-acl
  31. use_backend hauk if hauk-acl
  32. default_backend nextcloud
  33. backend nextcloud
  34. # http://cbonte.github.io/haproxy-dconv/1.5/configuration.html#option%20http-server-close
  35. #option http-server-close
  36. #option forwardfor
  37. #redirect http to https
  38. #redirect scheme https if !{ ssl_fc }
  39. # https://www.haproxy.com/de/blog/haproxy-and-http-strict-transport-security-hsts-header-in-http-redirects/
  40. # https://www.haproxy.com/blog/haproxy-and-http-strict-transport-security-hsts-header-in-http-redirects/
  41. http-response set-header Strict-Transport-Security "max-age=15552000; includeSubDomains; preload;"
  42. server nextcloud nextcloud:443 maxconn 32 check ssl verify none
  43. backend gitea
  44. #redirect http to https
  45. #redirect scheme https if !{ ssl_fc }
  46. server gitea gitea:2443 maxconn 32 check ssl verify none
  47. #backend blog1
  48. # # https://forum.ghost.org/t/cant-get-full-site-ssl/12478/6
  49. # # https://blog.woodenstake.se/starting-a-blog-again/
  50. # option forwardfor
  51. # http-request set-header X-Forwarded-Port %[dst_port]
  52. # http-request add-header X-Forwarded-Proto https if { ssl_fc }
  53. # server blog1 blog1:2368 maxconn 32
  54. backend hauk
  55. server hauk hauk:80 maxconn 32
  56. frontend http-in
  57. bind *:80
  58. acl letsencrypt-acl path_beg /.well-known/acme-challenge/
  59. #acl is_nextcloud hdr_end(host) -i ${NEXTCLOUD_URL}
  60. #acl is_gitea hdr_end(host) -i ${GITEA_URL}
  61. acl is_nextcloud hdr_reg(host) ^${NEXTCLOUD_SERVER_NAME}\.
  62. acl is_gitea hdr_reg(host) ^${GITEA_SERVER_NAME}\.
  63. acl is_hauk hdr_reg(host) ^${HAUK_SERVER_NAME}\.
  64. use_backend letsencrypt-backend if letsencrypt-acl
  65. use_backend nextcloud-insecure if is_nextcloud
  66. use_backend gitea-insecure if is_gitea
  67. use_backend hauk-insecure if is_hauk
  68. #default_backend pihole-insecure
  69. backend nextcloud-insecure
  70. http-response set-header Strict-Transport-Security "max-age=15552000; includeSubDomains; preload;"
  71. server nextcloud nextcloud:80 maxconn 32
  72. backend gitea-insecure
  73. server gitea gitea:3000 maxconn 32
  74. backend hauk-insecure
  75. server hauk hauk:80 maxconn 32
  76. #backend pihole-insecure
  77. # server pihole pihole:80 maxconn 32
  78. # LE Backend
  79. backend letsencrypt-backend
  80. server letsencrypt 127.0.0.1:8888
  81. #listen admin
  82. # bind 127.0.0.1:8080
  83. # stats enable