执行https重定向时ktor重定向到0.0.0.0

问题描述

我已将http重定向添加到我的Ktor应用程序中,并将其重定向到https://0.0.0.0而不是实际域的https

@ExperimentalTime
fun Application.module() {

    if (ENV.env != LOCAL) {
        install(ForwardedHeaderSupport)
        install(XForwardedHeaderSupport)
        install(HttpsRedirect)
    }

拦截路由并打印出主机

    routing {

            intercept(ApplicationCallPipeline.Features) {
            val host = this.context.request.host()

我似乎为主机获得了0:0:0:0:0:0:0:0

我是否需要向Google Cloud的负载均衡器添加任何特殊标头才能使此https重定向正常工作?似乎没有选择正确的主机

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)