http - HAProxy 将 http 重定向到 https (ssl)

标签 http redirect ssl https haproxy

我正在使用 HAProxy 进行负载平衡,并且只希望我的站点支持 https。因此,我想将端口 80 上的所有请求重定向到端口 443。

我该怎么做?

编辑:我们想重定向到 https 上的相同 url,保留查询参数。因此,http://foo.com/bar将重定向到 https://foo.com/bar

最佳答案

I found this to be the biggest help :

使用 HAProxy 1.5 或更新版本,只需将以下行添加到前端配置:

redirect scheme https code 301 if !{ ssl_fc }

关于http - HAProxy 将 http 重定向到 https (ssl),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13227544/

相关文章:

redirect - 在 Chrome 中内联 javascript 重定向之前中断 javascript

java - 使用 SSL 通过 JDBC 连接到 Google Cloud PostgreSQL

web-services - Axis 、Glassfish、SSLHandshakeException

php - 执行代码后重定向

Java,通过 SSL 连接时出错(远程主机在握手期间关闭连接)

http - php-fpm 每天停止多次

rest - HTTP PUT 请求限制

node.js http 模块 http.createServer 是如何工作的?

http - angularjs + mongolab $http.put 不更新模型

redirect - 重定向到GSP失败