proxy.Balancer middleware should handle http backend servers when using app.ListenTLS
ganlvtech opened this issue · comments
Ganlv commented
need add req.URI().SetScheme("http")
in proxy.Balancer
req.SetRequestURI(utils.UnsafeString(req.RequestURI()))
// NOTE: if req.isTLS is true, SetRequestURI keeps the scheme as https.
// Reference: https://github.com/gofiber/fiber/issues/1762
if scheme := getScheme(utils.UnsafeBytes(copiedURL)); len(scheme) > 0 {
req.URI().SetSchemeBytes(scheme)
}
fiber/middleware/proxy/proxy.go
Lines 80 to 81 in 109ccdd
fiber/middleware/proxy/proxy.go
Lines 180 to 186 in 109ccdd
welcome commented
Thanks for opening your first issue here! 🎉 Be sure to follow the issue template! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord