Cookbooks
haproxy
documentation
Haproxy Frontend

Back To Resource List (opens in a new tab)


haproxy_frontend

Frontend describes a set of listening sockets accepting client connections.

Introduced: v4.0.0

Actions

  • :create
  • :delete

Properties

This resource also uses the following partial resources:

NameTypeDefaultDescriptionAllowed Values
bindString, Hash0.0.0.0:80String - sets as given. Hash joins with a space
modeStringNoneSet the running mode or protocol of the instancehttp, tcp
maxconnIntegerNoneSets the maximum per-process number of concurrent connections
reqrepString, ArrayNoneReplace a regular expression with a string in an HTTP request line
reqirepString, ArrayNonereqrep ignoring case
default_backendStringNoneSpecify the backend to use when no "use_backend" rule has been matched
use_backendArrayNoneSwitch to a specific backend if/unless an ACL-based condition is matched
aclArrayNoneAccess control list itemsAllowed HAProxy acl values
optionArrayNoneArray of HAProxy option directives
statsHashNoneEnable stats with various options

Examples

haproxy_frontend 'http-in' do
  bind '*:80'
  default_backend 'servers'
end
 
haproxy_frontend 'tcp-in' do
  mode 'tcp'
  bind '*:3307'
  default_backend 'tcp-servers'
end