HAProxy redirecting http to https (ssl)

前端 未结 16 1538
你的背包
你的背包 2020-12-22 22:04

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?<

16条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-22 23:02

    Why don't you use ACL's to distinguish traffic? on top of my head:

    acl go_sslwebserver path bar
    use_backend sslwebserver if go_sslwebserver
    

    This goes on top of what Matthew Brown answered.

    See the ha docs , search for things like hdr_dom and below to find more ACL options. There are plenty of choices.

提交回复
热议问题