HAProxy redirecting http to https (ssl)

前端 未结 16 1445
你的背包
你的背包 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:46

    A slight variation of user2966600's solution...

    To redirect all except a single URL (In case of multiple frontend/backend):

    redirect scheme https if !{ hdr(Host) -i www.mydomain.com } !{ ssl_fc }
    

提交回复
热议问题