我正在使用 HAProxy 进行负载平衡,并且只希望我的站点支持 https。因此,我想将端口 80 上的所有请求重定向到端口 443。
我该怎么做?
编辑:我们想重定向到 https 上的相同 url,保留查询参数。因此,http://foo.com/bar将重定向到 https://foo.com/bar
最佳答案
I found this to be the biggest help :
使用 HAProxy 1.5 或更新版本,只需将以下行添加到前端配置:
redirect scheme https code 301 if !{ ssl_fc }
关于http - HAProxy 将 http 重定向到 https (ssl),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13227544/