@mr_blond97

Как в haproxy сделать редирект с http на https?

Пробую как в мануале делать. https://serversforhackers.com/using-ssl-certificat...

Работает, если по https:// заходить. Если по http то выдает:

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?


Вот конфиг:

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
  • Вопрос задан
  • 1947 просмотров
Пригласить эксперта
Ответы на вопрос 1
@shuraosipov
Redirect all HTTP traffic to HTTPS when SSL is handled by haproxy.
redirect scheme https if !{ ssl_fc }

Reference - cbonte.github.io/haproxy-dconv/configuration-1.7.h...
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы