Enable SSL in Haproxy Docker Container

I have a haproxy container running on port 80. This container is started with command

This haproxy used following configuration file /home/ubuntu/haproxy/haproxy.cfg

To make this haproxy work with SSL, first create a ssl.pem file with your SSL certificate contents in following order

copy and paste all those certs into ssl.pem file inside /home/ubuntu/haproxy/ssl.pem

Now modify your /home/ubuntu/haproxy/haproxy.cfg file as follows

Now we need to stop current docker container as it only allow port 80 to be shared.

Lets create a new haproxy container with port 443 forwaded.

See Haproxy

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *