我正在使用HAProxy进行负载均衡,只希望我的站点支持https。因此,我想将端口80上的所有请求重定向到端口443。
我该怎么做呢?
编辑:我们希望重定向到https上的相同url,保留查询参数。因此,http://foo.com/bar将重定向到https://foo.com/bar
frontend httpfront
mode http
bind *:80
redirect scheme https code 301 if !{ ssl_fc }发布于 2019-04-12 22:11:42
需要为443端口配置前端。
前端(端口80) ->前端(端口443) ->后端
查看我的示例:
frontend httpfront
mode http
bind *:80
redirect scheme https code 301 if !{ ssl_fc }
frontend httpsfront
mode tcp
bind *:443
default_backend app
backend app
mode tcp
balance roundrobin
server server01 10.10.10.11:443 check
server server02 10.10.10.12:443 checkhttps://stackoverflow.com/questions/55652192
复制相似问题