Cookbooks
haproxy
documentation
Haproxy Use Backend

Back To Resource List (opens in a new tab)


haproxy_use_backend

Switch to a specific backend if/unless an ACL-based condition is matched.

Introduced: v4.2.0

Actions

  • :create
  • :delete

Properties

This resource also uses the following partial resources:

NameTypeDefaultDescriptionAllowed Values
use_backendString, ArrayNoneSwitch to a specific backend if/unless an ACL-based condition is matched
sectionStringNoneThe section where the acl(s) should be appliedfrontend, listen, backend
section_nameStringNoneThe name of the specific frontend, listen or backend section

Examples

haproxy_use_backend 'gina if gina_host' do
  section 'frontend'
  section_name 'http'
end
haproxy_use_backend 'use_backends for frontend:http' do
  section 'frontend'
  section_name 'http'
  use_backend [
    'rrhost if rrhost_host',
    'tiles_public if tile_host',
  ]
end