HAProxy Configuration
HAProxy
You can use your Manifest file to configure and define any HAProxy load balancers deployed by Cloud 66. These changes will be either be applied when you redeploy an application with more than one server, rebuild HAProxy or edit HAProxy CustomConfig.
Because HAProxy load balancers are not "cloud native", you will need to specify the server configuration in the same YAML node as your HAProxy settings. The server configuration settings are :
Server options | Applied on | Description |
---|---|---|
key_name | Default | |
region | DigitalOcean's region | |
size | The size of the instance | |
unique_name | Name of the instance |
The following HAProxy settings are available via the Manifest file:
Option | Applied on | Description |
---|---|---|
balance | The load balancing strategy. Valid values: roundrobin , leastconn or source | |
errorfile_*ERROR_CODE* | Location of your own custom error page(s) to serve in the case of receiving a HTTP error code on the load balancer. You can configure one page per error code. | |
haproxy_password | The password for your HAProxy stats interface. | |
haproxy_username | The username for your HAProxy stats interface. | |
httpchk | The URL visited to check your server health | |
wait_after_adding_servers | The time (in seconds) we will wait after adding a server back to the load balancer before we begin routing traffic to that server. Read our in-depth guide on configuration lag for more details. | |
wait_after_removing_servers | The time (in seconds) we will wait after adding a server back to the load balancer before we begin routing traffic to that server. Read our in-depth guide on configuration lag for more details. |
Refer to the HAProxy documentation for more information
Example YAML for HAProxy load balancers
Automatic endpoint test
Load balancers periodically check the health of your servers by connecting to a URL endpoint. If the server responds with an HTTP 200 OK status, it is considered healthy. The httpchk
setting allows you to specify which URL path should be checked.
The default value is HEAD / HTTP/1.1\\r\\nHost:haproxy
but you can customize it to any valid endpoint in your application that returns a 200 status when healthy.