如何使用GCP负载均衡器将HTTPS重定向到HTTP

huangapple go评论58阅读模式
英文:

How to redirect HTTPS to HTTP using GCP load balancer

问题

这是一个关于如何重定向 https -> http 的问题,不是 http -> https。

我们正在使用Cisco路由器进行WiFi登录。我们的欢迎页面位于我们的网站上,使用的是http。路由器要求使用http。这对于Android和Windows等系统运行正常,但对于iOS和MacOS不起作用,它们会寻找https并在可能的情况下使用它。

网站是WordPress,两个负载均衡器和虚拟机之间的连接是http,因此使用 $_SERVER['HTTPS'] 不起作用,使用它或 $_SERVER['HTTP_X_FORWARDED_PROTO'] - 我相信可能会在Apple操作系统上引发无限重定向。

所以,我需要的是将路径 /wifi-login/https:// 重定向到 http://,我认为这需要在负载均衡器级别完成。

英文:

This is a question on

how to redirect https -> http,

NOT http -> https.

We are using a Cisco router for our wifi login. Our splash page is on our website, which is http. The router requires http. This works fine for android and windows, etc, but does not work for iOS and MacOS, which will will look for https and use it if possible.

The site is wordpress and the connection between the two load balancers and the VMs is http, so using $_SERVER['HTTPS'] wouldn't work, and using that or $_SERVER['HTTP_X_FORWARDED_PROTO'] - I believe may cause an infinite redirect on Apple OS's.

So, what I need is for the path /wifi-login/ to be redirected to http:// if it is https. I think this needs to be done on the load balancer level.

答案1

得分: 1

我可以考虑的解决方法是编辑已创建的 HTTPS 负载均衡器。编辑 HTTPS 流量的前端配置。查找"协议"部分并将其从"HTTPS"更改为"HTTP"。将前端配置更改为侦听 HTTP 流量,这可能会将 HTTPS 重定向到 HTTP。

英文:

What I can think that we can try for this concern is to edit the created https Load balancer. Edit the frontend configuration for https traffic .Look for the "Protocol" section and change it from "HTTPS" to "HTTP." Changing frontend configuration to listen for http traffic it may redirect https to http.

huangapple
  • 本文由 发表于 2023年7月18日 01:12:11
  • 转载请务必保留本文链接:https://go.coder-hub.com/76706709.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定