Author(s): Nick Ramirez
Series: B01M5CAJ2L
Year: 0
Language: English
Pages: 172
Open-source technology for better scalability, redundancy and availability in your IT infrastructure......Page 1
Table of Contents......Page 6
What is HAProxy?......Page 9
What are some of its benefits?......Page 10
What does it cost?......Page 11
Summary......Page 12
Creating virtual machines with Vagrant......Page 14
Installing on Ubuntu......Page 16
Installing on Debian......Page 18
Installing on CentOS......Page 19
Installing with Docker......Page 21
Summary......Page 25
Proxying basics......Page 27
Load balancing basics......Page 33
TCP vs HTTP mode......Page 34
Capturing the client's IP address......Page 36
Using ACLs......Page 38
Enabling the HAProxy stats page......Page 40
Summary......Page 45
Roundrobin algorithm......Page 47
Leastconn algorithm......Page 48
Hash URI algorithm......Page 50
First available algorithm......Page 51
Summary......Page 52
Content switching on the URL path......Page 54
Content switching on a URL parameter......Page 56
Content switching on an HTTP header......Page 57
Redirecting to another URL......Page 58
Redirecting based on geolocation......Page 60
Summary......Page 62
TCP-based health checks......Page 64
HTTP-based health checks......Page 65
Expecting specific responses......Page 67
Relying on the status of another server......Page 68
Setting a backup server......Page 69
Failing over when not enough servers are left......Page 70
Observing all requests for errors......Page 71
Monitoring for server downtime......Page 72
Emailing alerts......Page 75
Summary......Page 78
Using a cookie to stick to a server......Page 80
Using a stick-table for server persistence......Page 81
Redispatching to another server......Page 83
Forcing persistence on a down server......Page 84
Ignoring persistence for some files......Page 85
Summary......Page 86
Sending logs to syslog......Page 88
Logging to a remote syslog server......Page 90
Splitting up log messages by tag......Page 92
Better TCP logging......Page 93
Better HTTP logging......Page 96
Logging cookies and headers......Page 99
Separating errors into their own log file......Page 100
Summary......Page 102
TLS passthrough......Page 104
TLS termination......Page 109
TLS re-encryption......Page 112
Redirecting HTTP traffic to HTTPS......Page 113
Restricting versions of SSL......Page 114
SSL ciphers......Page 117
Summary......Page 118
URL rewriting......Page 120
Adding request headers......Page 124
Adding response headers......Page 126
Compressing outgoing files with gzip......Page 129
Device detection with 51Degrees......Page 130
Summary......Page 134
Running HAProxy in a chroot......Page 136
Enabling basic authentication......Page 138
Preventing too many parallel connections......Page 140
Defending against HTTP slow requests......Page 141
Rate limiting......Page 144
Denying requests from an attacker for a time......Page 146
Whitelisting IP addresses......Page 148
Summary......Page 150
Using socket commands......Page 152
Enabling and disabling a server......Page 154
Changing the weight of a server......Page 155
Working with stick tables......Page 156
Debugging the HAProxy service......Page 158
Summary......Page 159
Reloading without a restart......Page 161
Adding a failover load balancer......Page 163
Replicating stick-tables to peers......Page 168
Syncing configuration......Page 169
Summary......Page 172