Skip to main content

haproxy: ssl backends

10-12-2013 | Remy van Elst | Text only version of this article

Table of Contents

This snippets shows you how to add an ssl backend to HAPROXY. You need haproxy 1.5 or higher, 1.4 does not support ssl backends.

This snippet is tested on a Digital Ocean VPS. If you like this snippet and want to support me, use this link to order a Digital Ocean VPS:

Note: this is not about adding ssl to a frontend. this allows you to use an ssl enabled website as backend for haproxy.

The following config is required in a backend section:

backend example-backend
  balance roundrobin
  option httpchk GET /health_check
  server srv01 weight 1 maxconn 100 check ssl verify none
  server srv02 weight 1 maxconn 100 check ssl verify none

The important parts are: 
ssl verify none

You can also specify verify all. As expected, this will verify all certificates, however this will generate extra load. For this example setup the verify none is good enough.

More Info:

Tags: apache  haproxy  loadbalancer  snippets  ssl