Avoid redirect loop when ssl_enabled is true [fixes #72486232]