【问题标题】:Google Cloud Load balancer (exclude specific port)谷歌云负载平衡器(排除特定端口)
【发布时间】:2017-03-26 19:00:56
【问题描述】:

我刚刚设置了 google Cloud 的 https 负载均衡器,它似乎工作正常(速度超快)。但是,我无法再访问特定端口上受 SSL 保护的页面。

例如 https://www.example.com(工作正常) https://www.example.com:8443(在启用负载均衡器的情况下不再工作)

当前设置: www 指向负载均衡器的 IP。

是否可以在负载均衡器中排除特定端口(例如 8443 / 8447)​​,以便将流量直接重定向到正确的服务器 IP? (例如绕过负载平衡器)。

感谢您的帮助!

~卢克

【问题讨论】:

    标签: routing google-cloud-platform load-balancing google-compute-engine


    【解决方案1】:

    不,不可能像这样排除任何端口。

    此外,据我了解,Google 负载平衡仅支持侦听特定端口(HTTP 为 80/8080,HTTP 为 443)。无法在其配置中提供自定义端口。

    如果您想直接访问运行在 8443 上的服务,您可以随时使用实例的 ip 或主机名 ( instance-host:8443 ) 直接调用该实例。

    如果您想对服务进行负载均衡,那么您有两种选择:

    1. 仅在标准端口上运行服务。
    2. 在实例或本地代理上使用端口转发,如 HAProxy (Google cloud load balancer port 80, to VM instances serving port 9000)。

    【讨论】:

    • 感谢您的解决方案!通过将 A 记录直接设置为服务器 ip 并将 www 设置为负载平衡器 IP 来解决此问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-12-31
    • 2021-03-18
    • 1970-01-01
    • 1970-01-01
    • 2015-11-04
    • 1970-01-01
    • 2017-01-20
    相关资源
    最近更新 更多