Skip to content
This repository has been archived by the owner on Aug 17, 2021. It is now read-only.

Load Balancer for HTTP and HTTPS

satrapu edited this page Oct 14, 2017 · 5 revisions

This page details how to setup a load balancer to distribute HTTPS requests made against several instances of DokuWiki hosted on a running instance of Rancher server.

More information can be found here and here.

  1. In order for the load balancer previously added via Load Balancer for HTTP Only to server HTTPS requests, a certificate must be added to Rancher server

    1. Generate a certificate
    2. Follow the steps described here: https://www.akadia.com/services/ssh_test_certificate.html or
    3. Use the one provided by Docker Machine
      1. On Windows, this certificate is found here: %USER%.docker\machine\certs\ca.pem, while its private key is found here: %USER%.docker\machine\certs\ca-key.pem

    For production grade Rancher server, use VALID certificates!
    For the purpose of this workshop, any certificate will do.

  2. Go to Rancher UI

  3. Go to menu → Infrastructure → Certificates

  4. Click "Add Certificate" button

  5. Fill in the field appropriately

    1. Name: tgd
    2. Description: Certificate to be used by the tgd load balancer.
    3. Private Key: paste here the contents of the private key file
    4. Certificate: paste here the contents of the certificate file
  6. Click the "Save" button

  7. Edit the Load Balancer for HTTP Only and add 2 new Service Rules, both using HTTPS protocol

    1. Service Rule 1
      1. Access: Public
      2. Protocol: HTTPS
      3. Request Host: leave empty
      4. Port: 443 (the default port used for serving content over HTTPS)
      5. Path: /
      6. Target: dokuwiki-server from stack dokuwiki1
      7. Port: 80
    2. Do the same for Service Rule 2, just change Target to dokuwiki-server from stack dokuwiki2
  8. Click the "Edit" button

  9. Go to the load balancer service and click the new "443/tcp" link from Ports field

  10. In case the certificate leads to the browser displaying a warning, just ignore it (for production, the load balancer should be reachable via a domain name which must be included inside the certificate)

  11. You should now see both DokuWiki instances over HTTPS

Clone this wiki locally