HAProxy redirecting http to https (ssl)

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

    Add this into the HAProxy frontend config:

    acl http      ssl_fc,not
    http-request redirect scheme https if http
    

    HAProxy - Redirecting HTTP Requests

提交回复
热议问题