Config file looks like

    1. global
    2. nuster cache on data-size 100m uri /_nuster
    3. nuster nosql on data-size 200m
    4. defaults
    5. mode http
    6. frontend fe
    7. bind *:8080
    8. #bind *:4433 ssl crt example.com.pem alpn h2,http/1.1
    9. use_backend be2 if { path_beg /_kv/ }
    10. default_backend be1
    11. backend be1
    12. nuster cache on
    13. nuster rule img ttl 1d if { path_beg /img/ }
    14. nuster rule api ttl 30s if { path /api/some/api }
    15. server s1 127.0.0.1:8081
    16. server s2 127.0.0.1:8082
    17. backend be2
    18. nuster nosql on
    19. nuster rule r1 ttl 3600

    There are four basic sections: global, defaults, frontend and backend.

    • global
      • defines process-wide and often OS-specific parameters
      • nuster cache on or nuster nosql on must be declared in this section in order to use cache or nosql functionality
    • defaults
      • defines default parameters for all other frontend, backend sections
      • and can be overwritten in specific frontend or backend section
    • frontend
      • describes a set of listening sockets accepting client connections
    • bankend
      • describes a set of servers to which the proxy will connect to forward incoming connections
      • nuster cache on or nuster nosql on must be declared in this section
      • nuster rule must be declared hereYou can define multiple frontend or backend sections.

    You can find HAProxy documentation in /doc, and Online HAProxy Documentation