Using cloudfare domain and specified port


I have setup a Cloudflare domain to point to my IP with proxy setting on. As I understand it, the domain will be redirected to my specified IP via Cloudflare’s server. Hence when I nslookup my domain, cloudfares IP address comes up.

My server uses https and I have opened specified ports (8000, 8001 on the server).

When I try, the page does not load.

If I turn the proxy setting off and use it, the page does load.

When I test open ports, with the proxy setting on, the ports are open.

How come the page will not load with the Cloudflare proxy setting turned on?

Cloudflare’s edge only listens on these ports (unless using Spectrum)…

You can set up subdomains for the different services you run on each port (you will connect without specifying a port) and use origin rules to tell Cloudflare’s proxy to connect to your origin server on that port:

1 Like

Thanks for the reply

I created an origin rule to rewrite all incoming requests to port 8000, but it still does not work.

Also - If I create a subdomain, say, how do I specify the origin rule to re-route all traffic from that subdomain to port 8000? Which option is it under custom filter expression?

Also do you need to create the subdomain first under DNS management?

You need a proxied subdomain pointing to the IP address of your server, and configure origin rules like this…

Thank you!

Sorry one more question, I have an SSH server setup which I can access via my static IP on port 8001, but what type of rule do I setup in Cloudflare so I can access the SSH server via the subdomain?

I have tried origin rule with hostname, but that doesn’t work.

You can’t use SSH on a proxied hostname. Either use the IP directly or create a new subdomain that is not proxied.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.