I\'m using HAProxy for load balancing and only want my site to support https. Thus, I\'d like to redirect all requests on port 80 to port 443.
How would I do this?<
The best guaranteed way to redirect everything http to https is:
frontend http-in
bind *:80
mode http
redirect scheme https code 301
This is a little fancier using ‘code 301′, but might as well let the client know it’s permanent. The ‘mode http’ part is not essential with default configuration, but can’t hurt. If you have mode tcp
in defaults section (like I did), then it’s necessary.