Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using HAProxy as a load balancer and i'd like to redirect any traffic that comes in on 443 (HTTPS) to 80 (HTTP). My site doesn't support HTTPS at all and i'd rather just redirect users than cause any SSL warnings in browsers.

All I can find is using the redirect location <to> syntax, but as far as I can tell that requires me to hard code the hostname. The load balancer receives connections for various hostnames so would like to keep it relative.

share|improve this question
Why would there be any https traffic at all? – Michael Hampton Dec 8 '12 at 22:37
If someone hits up the site with https:// I don't want their request to hit a dead end. – tarnfeld Dec 8 '12 at 22:38
They'd still get a certificate warning before the redirect and there is not point serving something that you don't serve ;). Just don't enable https. – Christopher Perrin Dec 8 '12 at 23:04
up vote 3 down vote accepted

That won't work. If a user enters into their browser and it connects to port 443 then it requires SSL to be there. You can't even cause the redirect without having SSL properly set up.

In other words: if a user already connects to 443 then it's too late for you to avoid proper SSL.

Keeping the port closed is probably the "best" thing you can do - apart from getting SSL setup properly.

share|improve this answer
Bah! Of course. Nevermind. – tarnfeld Dec 8 '12 at 23:45

Yes you can, just put the redirect rule in your ssl frontend for the host... something like this

redirect scheme http if { hdr(Host) -i } { ssl_fc }
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.