Skip to content
Tristan Le Guern edited this page Apr 24, 2019 · 3 revisions

frontends

The frontends section can be configured with the YAML tree haproxy_frontends.

Example:

haproxy_frontends:
- name: fe-static
  bind:
  - 0.0.0.0:80
  mode: http
  maxconn: 30000
  acl:
  - { name: acl-is-static, condition: path_beg /static }
  use_backend:
  - { name: be-static, confition: if acl-is-static }

name

String.

ip

String, optional.

port

String, optional.

bind

List, optional.

Examples:

bind:
- 0.0.0.0:80
- 0.0.0.0:1937

ssl

Optional and only useful in conjunction to bind as it will be applied to each of its elements.

Accepts a list of mappings in the following format:

  • cert: optional ;
  • ciphers: optional.

mode

String, optional.

Example:

mode: http

maxconn

Numerical, optional.

timeout

Optional.

Accepts a mapping in the following format:

  • param ;
  • value.

Example:

timout:
- param: connect
  value: 5000

acl

Optional.

Accepts a mapping in the following format:

  • name ;
  • condition.

Example:

acl:
- name: acl-is-root
  condition: path -i /

acl:
- { name: acl-is-root, condition: path -i / }
- { name: acl-is-static, condition: path_beg /static }

monitor

Optional.

Accepts a mapping in the following format:

  • uri: string, optional ;
  • fail: list, optional.

Example:

monitor:
  uri: /site
  fail:
  - if acl-site-dead
  - unless acl-localhost

capture

List, optional.

Example:

capture:
- request header User-Agent len 64

reqadd

List, optional.

rspadd

List, optional.

reqrep

List, optional.

reqirep

List, optional.

rsprep

List, optional.

respirep

List, optional.

rate_limit_sessions

Numerical, optional.

block

List, optional.

options

List, optional.

redirects

List, optional.

tcp_request

Optional.

Accepts a list of mappings in the following format:

  • param ;
  • value ;
  • condition: optional.

http_request

Optional.

Accepts a list of mappings in the following format:

  • action ;
  • param: optional ;
  • condition: optional.

Example:

http_request:
- { action: auth, condition: unless acl-auth }

http_response

Optional.

Accepts a list of mappings in the following format:

  • action ;
  • param: optional ;
  • condition: optional.

default_backend

String, optional.

use_backend

Optional.

Accepts a list of mappings in the following format:

  • name ;
  • condition.

Example:

use_backend:
- { name: be-static, condition: if acl-static }

force_persist

String, optional.

Clone this wiki locally