How to create a Cloudflare Pages website on non-standard ports such as :2345?
I have the source of an abandoned website, which is a website can run without server based on EJS. In the original server, the default port is set on :2345. I want to inherit this tradition of making the default port at :2345, but I want to use Cloudflare Pages to reduce the cost of a physical server. So how can I setup the website on port :2345 on Cloudflare Pages?
10 Replies
You can't nor is this normal for sites
Are you wanting users to connect on :2345?
Yes.
They can only connect to :2345 in my case.
Yeah not possible
What if using functions or workers?
No, Cloudflare itself just doesn't accept non-standard ports
You can't connect to a Cloudflare site over :2345 without using something like Spectrum which is a very different setup/purpose
So if I tryly want to make it, I have to add a DNS rule to make a redirection?
using the type SRV
to map port :2345 to the standard port :80?
SRV records don't work with http/https, they have a very specific meaning for a limited amount of protocols
Expect you could run NGINX on a basic Digital Ocean droplet for 4USD a month and rewrite the URLs
So how can I do that freely?
Is it possible to use Origin Rules for another domain (e.g. havyuxew.com) to redirect port havyuxew.com:2345 to my Pages website xxx.pages.dev:80 and redirect havyuxew.com:80 to xxx.pages.dev:2345?
Or page rules?
Cloudflare doesn't accept port 2345 without something specialised like Spectrum which is not intended for this and would be expensive for this
Again, I'd really just recommend using a standardised web port.