Why frappe.Redirect exception redirect to base URL without Port Number

I am facing problem with frappe.Redirect exception.

my website is running on https://<domain_name>:8080, and whenever I am trying to redirect the unauthenticated user to login page using frappe.Redirect exception, it’s only redirecting to base url(which is https://<domain_name>, without port number).

frappe.flags.redirect_location = "/login"
raise frappe.Redirect

I’m having the opposite issue aha, it keeps using port 8000 at the end of my URL