Skip to content

Instantly share code, notes, and snippets.

@haproxytechblog
Created November 10, 2020 14:45
Show Gist options
  • Save haproxytechblog/60fde86e1aa9e687055d67973ab53795 to your computer and use it in GitHub Desktop.
Save haproxytechblog/60fde86e1aa9e687055d67973ab53795 to your computer and use it in GitHub Desktop.
Layer 4 and Layer 7 Proxy Mode
defaults
# mode is inherited by sections that follow
mode tcp
frontend db
# receives traffic from clients
bind :3306
default_backend databases
backend databases
# relays the client messages to servers
server db1 192.168.0.10:3306
server db2 192.168.0.11:3306
defaults
# mode is inherited by sections that follow
mode http
frontend www
# receives traffic from clients
bind :80
default_backend web_servers
backend web_servers
# relays the client messages to servers
server s1 192.168.0.10:3000
server s2 192.168.0.11:3000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment