M
M
mr_blond972015-09-19 20:21:38
HAproxy
mr_blond97, 2015-09-19 20:21:38

How to redirect from http to https in haproxy?

I'm trying to do it like in the manual. https://serversforhackers.com/using-ssl-certificat...

Works if you visit https://. If via http it gives:

Bad Request 
Your browser sent a request that this server could not understand.
Reason: You're speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please.
Как сделать редирект с http на https?


Here is the config:

frontend myfrontend
bind *:80
bind *:443
option tcplog
mode tcp
default_backend nodes
backend nodes
mode tcp
balance roundrobin
option ssl-hello-chk
server web01 *.*.*.*:443 check

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
shuraosipov, 2016-02-25
@shuraosipov

Redirect all HTTP traffic to HTTPS when SSL is handled by haproxy.
Reference - cbonte.github.io/haproxy-dconv/configuration-1.7.h...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question