Protocol Support
A DigitalOcean Load Balancer can be configured to handle multiple protocols and ports. You can control traffic routing with configurable rules that control the ports and protocols that the load balancer should listen on, as well as how requests are selected and forwarded to backend servers.
SinceDigitalOcean Load Balancers are network load balancers, not application load balancers, they do not support directing traffic to specific backends based on URLs, cookies, HTTP headers, etc.
HTTP
Standard HTTP load balancers route requests based on standard HTTP mechanisms. The load balancer sets the X-Forwarded-For, X-Forwarded-Proto, and X-Forwarded-Port headers to provide information about the original request to the backend servers.
If the user sessions depend on the client always connecting to the same backend, a cookie can be sent to the client to enable the session to persist.
HTTPS and HTTP/2
You can balance secure traffic using HTTPS or HTTP/2. Both protocols can be used with:
SSL termination, which performs SSL decryption on the load balancer after adding the SSL certificate and private key. Your load balancer can also act as a gateway between HTTP/2 client traffic and HTTP/1.0 or HTTP/1.1 backend applications.
SSL passthrough, which sends encrypted traffic to your backend droplets. This is good for end-to-end encryption and distributing SSL decryption overhead, but you will need to manage SSL certificates yourself.
You can configure load balancers to redirect HTTP traffic on port 80 to HTTPS or HTTP/2 on port 443. That way, the load balancer can listen for traffic on both ports but forward unencrypted traffic for better security.
TCP BALANCING
TCP balancing is available for applications that don’t talk HTTP. For example, installing a load balancer in front of a database cluster like Galera allows you to distribute requests across all available machines.