HAProxy redirecting http to https (ssl)
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 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? Edit: We'd like to redirect to the same url on https, preserving query params. Thus, http://foo.com/bar would redirect to https://foo.com/bar 回答1: I found this to be the biggest help : Use HAProxy 1.5-dev13 or newer, and simply add the following line to the frontend config: redirect scheme https code 301 if !{ ssl_fc } 回答2: I don't have enough reputation to comment on a previous