HAProxy redirecting http to https (ssl)

前端 未结 16 1443
你的背包
你的背包 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 22:53

    I found this to be the biggest help:

    Use HAProxy 1.5 or newer, and simply add the following line to the frontend config:

    redirect scheme https code 301 if !{ ssl_fc }
    

提交回复
热议问题