Trouble setting up http-to-https redirection

Do as described here: https://github.com/rancher/rancher/issues/3505#issuecomment-264308277

  1. Add selector rule in your balancer with protocol “HTTP”, request host “*”, port “80” and target “foo=bar” (actually any target that won’t select any service). It will force balancer to expose 80 port, but it won’t actually change haproxy.cfg, because there is no service with the target.
  2. In “Custom haproxy.cfg” add this
    frontend http-frontend
    bind *:80
    mode http
    redirect scheme https if !{ ssl_fc }
  3. Save balancer configs. All http requests will be redirected to https :wink: