haproxy.old 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. global
  2. {{ log_0 }}
  3. {{ log_1 }}
  4. {{ log_2 }}
  5. chroot /var/lib/haproxy
  6. pidfile {{ haproxy_pid }}
  7. maxconn 4000
  8. user haproxy
  9. group haproxy
  10. daemon
  11. # turn on stats unix socket
  12. stats socket {{ haproxy_stats_socket }}
  13. stats timeout 30s
  14. # Default SSL material locations
  15. ca-base /etc/ssl/certs
  16. crt-base /etc/ssl/private
  17. # See: https://ssl-config.mozilla.org/#server=haproxy&server-version=2.0.3&config=intermediate
  18. ssl-default-bind-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
  19. {{ ssl_ciphersuites }}
  20. {{ ssl_options }}
  21. {{ ssl_dh }}
  22. defaults
  23. mode http
  24. log global
  25. option httplog
  26. option dontlognull
  27. #option http-server-close
  28. #option forwardfor except 127.0.0.0/8
  29. #option redispatch
  30. #retries 3
  31. #timeout http-request 10s
  32. #timeout queue 1m
  33. timeout connect 10s
  34. timeout client 1m
  35. timeout server 1m
  36. #timeout http-keep-alive 10s
  37. #timeout check 10s
  38. maxconn 5000
  39. #errorfile 400 /etc/haproxy/errors/400.http
  40. #errorfile 403 /etc/haproxy/errors/403.http
  41. #errorfile 408 /etc/haproxy/errors/408.http
  42. #errorfile 500 /etc/haproxy/errors/500.http
  43. #errorfile 502 /etc/haproxy/errors/502.http
  44. #errorfile 503 /etc/haproxy/errors/503.http
  45. #errorfile 504 /etc/haproxy/errors/504.http
  46. frontend http_frontend
  47. mode {{ frontend_mode }}
  48. bind *:80
  49. bind *:443 ssl crt {{ ssl_crt_path }}/{{ ssl_name }}.pem alpn h2,http/1.1
  50. {% if nc_settings is sameas true %}
  51. maxconn 20000
  52. acl url_discovery_dav path /.well-known/caldav /.well-known/carddav
  53. acl url_discovery_inf path /.well-known/webfinger /.well-known/nodeinfo
  54. http-request redirect location /remote.php/dav/ code 301 if url_discovery_dav
  55. http-request redirect location /index.php%[capture.req.uri] code 301 if url_discovery_inf
  56. http-response set-header Strict-Transport-Security max-age=63072000
  57. {% endif %}
  58. option forwardfor
  59. option http-server-close
  60. {% if network_allowed != '' %}
  61. #Only allow some services to be available internally
  62. acl network_allowed src {{ network_allowed }}
  63. {% endif %}
  64. redirect scheme https code 301 if !{ ssl_fc }
  65. default_backend http_servers
  66. backend http_servers
  67. mode {{ backend_mode }}
  68. balance {{ backend_balance_method }}
  69. {% if nc_settings is sameas true %}
  70. option httpchk HEAD /
  71. cookie SERVERID insert indirect nocache
  72. http-check expect rstatus [2-3][0-9][0-9]
  73. http-response set-header X-Frame-Options SAMEORIGIN
  74. http-response set-header X-XSS-Protection 1;mode=block
  75. http-response set-header X-Content-Type-Options nosniff
  76. {{ backend_default_server }}
  77. {% endif %}
  78. {% if haproxy_backend_servers != '' %}
  79. {% for item in haproxy_backend_servers %}
  80. server {{ item }} {{ item }}:8000
  81. {% endfor %}
  82. {% endif %}