Changing a HTTPS URL from port 8443 to 443

Hello all. Im sure this has been asked before because when i search for it something always comes up, but the results always aren’t quite the answer that I’m looking for. Or it seems that way atleast.

OK so i have a web app running at digital ocean called CloudPanel. DNS is obviously hosted with Cloudflare. I created the A record as a cached record type so that I can take advantage of all of Cloudflare’s goodness. Initially what got me looking at Cloudflare was just an awesome DNS provider, but then when i read digital ocean’s setup guide for CloudPanel it mentioned how to integrate lets encrypt to get SSL working dynamically and i thought that was pretty damn cool so i started looking at what Cloudflare could actually do and I was absolutely blown away.

Right now the thing I’m trying to achieve is i want when someone goes to http or https but lets just focus on the https.

If someone goes to: [https://] CloudPanel [dot]mydomainname[dot]com:8443/* I want the port forwarded from port 8443 to 443 and the URL to the user is functional as [https://]CloudPfanel[dot.]mydomainname[dot.]com/*

As type this out, I am wondering if this is two different things i need to do? (3 if you include the http to https should someone not specifically type https)

Does clourflare have a magical way of making everything over port 8443 go thru port 443 and then rewriting the URL so to the user lets set they goto [https://] cloudpanel [dot].mydomainname[dot.]com/* in the backend its really sending the traffic to [https://]cloudpanel[dot.]mydomainname[dot.]com:8443/*

Also i would love it if someone typed in [http://] cloudpanel [dot.]mydomainname[dot.]com/* if it re-wrote to [https://] cloudpanel[dot.] mydomainname[dot.] com/*

For all of the above functionality to happen is that 3 different things I need to implement on Cloudflare’s system? What do i need to do to make this magic happen? Thanks so much guys and gals. Cheers!

Welcome to the Cloudflare Community.

CloudPanel is a web hosting control panel. It is deliberately listening on port 8443, because it is not meant to be accessed by your site visitors. It is an administration tool that is trying to let you restrict access to trusted management IPs without limiting access to your production sites running on the standard port.

The Cloudflare proxy does not map ports. It forwards requests on the port they were received. If you want to connect to a site that is listening on 8443 on the origin, that is where you will need to connect on Cloudflare.

If you want your CloudPanel to listen on port 443, you will need to either find a way in its configuration to bind it to that port, which I did not see in their documentation. You could always see if it will work through a reverse proxy running on the same host. You may want to join the CloudPanel Community on their Discord server to see how other more experienced users of that platform are using it.

As for redirecting HTTP to HTTPS, that is soemthing that can be handled easily in Cloudflare. You will see it mentioned in this #tutorial on redirecting to www.