2 Webservers running on 2 different HTTP(S) ports?

#1

Hello,

I’ve a website running with Node.JS on port 80 and cloudflare is redirecting the request to my ip address of my root server. I now want to create an API which runs on the same root server, with the same ip adress and I want to let it run on the same domain too.

My question is now:
My website is running on port 80 and can be requested over my domain https://test.com
I now want that my api runs on the same domain, how is this possible? Could I run my API on port 443?

I hope you understood me well, it’s hard to explain it. ^^

Thanks!

#2

Thats not really Cloudflare related. You simply cant run two services on the same port and IP address.

Why dont you run both services from the same webserver instance?