haproxy.cfg.j2 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. frontend http_frontend
  2. mode {{ frontend_mode }}
  3. bind *:80
  4. bind *:443 ssl crt {{ ssl_crt_path }}/{{ ssl_name }}.pem alpn h2,http/1.1
  5. {% if nc_settings is sameas true %}
  6. maxconn 20000
  7. acl url_discovery_dav path /.well-known/caldav /.well-known/carddav
  8. acl url_discovery_inf path /.well-known/webfinger /.well-known/nodeinfo
  9. http-request redirect location /remote.php/dav/ code 301 if url_discovery_dav
  10. http-request redirect location /index.php%[capture.req.uri] code 301 if url_discovery_inf
  11. http-response set-header Strict-Transport-Security max-age=63072000
  12. {% endif %}
  13. option forwardfor
  14. option http-server-close
  15. {% if network_allowed != '' %}
  16. #Only allow some services to be available internally
  17. acl network_allowed src {{ network_allowed }}
  18. {% endif %}
  19. redirect scheme https code 301 if !{ ssl_fc }
  20. default_backend http_servers
  21. backend http_servers
  22. mode {{ backend_mode }}
  23. balance {{ backend_balance_method }}
  24. {% if nc_settings is sameas true %}
  25. option httpchk HEAD /
  26. cookie SERVERID insert indirect nocache
  27. http-check expect rstatus [2-3][0-9][0-9]
  28. http-response set-header X-Frame-Options SAMEORIGIN
  29. http-response set-header X-XSS-Protection 1;mode=block
  30. http-response set-header X-Content-Type-Options nosniff
  31. default-server check maxconn 5000
  32. {% endif %}
  33. {% if haproxy_backend_servers != '' %}
  34. server {{ haproxy_backend_servers.name }} {{ haproxy_backend_servers.ip }}
  35. {% endif %}