Skip to main content Logo

Quis custodiet ipsos custodes?
Home | About | All pages | Cluster Status | RSS Feed | Gopher

haproxy: redirect to ssl or other website

Published: 09-12-2013 | Author: Remy van Elst | Text only version of this article

❗ This post is over eight years old. It may no longer be up to date. Opinions may have changed.

This snippet shows you how to use haproxy to redirect http traffic to https or any other website.

This snippet was tested on haproxy 1.5.

I'm developing a desktop monitoring app, Leaf Node Monitoring, open source, but paid. For Windows, Linux & Android, go check it out.

Consider sponsoring me on Github. It means the world to me if you show your appreciation and you'll help pay the server costs.

You can also sponsor me by getting a Digital Ocean VPS. With this referral link you'll get $100 credit for 60 days.

To redirect traffic from a haproxy frontend, use the following config:

frontend example-frontend
  redirect location

As you can see, the redirect location can be anything, for example, the ssl version of the frontend or any other website.

More info: dconv/configuration-1.5.html#redirect

Tags: apache , haproxy , loadbalancer , redirect , snippets , ssl