I recently started on a pro plan here, and I managed to proxy the website and do the easy stuff. Now, I would like to use Cloudflare with some legacy HTTPS services with custom ports. My question is: On the Pro plan, is it possible to rewrite/redirect access from https://service.example.com:12345 to https://service.example.com (implicit 443 port) and profit from Cloudflare protection?
I have seen ideas based on Spectrum (not available in my plan). Or maybe with Rules regex (not available in my plan).
No, as Cloudflare would have to receive the request in order to rewrite it, and it can’t as the proxy doesn’t listen on that port (unless using Spectrum).
You could have service.example.com unproxied in Cloudflare to do the redirect to service-new.example.com which is proxied and points to your server using a 301 redirect which will be cached by the browser so most requests will then go to your proxied host (use an origin rule if you want to still run the server on port 12345). You could even put service.example.com (the redirector) on a separate cheap VPS to avoid a DDoS taking down your main server or connection. Cloudflare would protect service-new.example.com