Host multiple website on the same host

Hello,

I would like to host multiple websites, but from the same vps, with the same ip.

For exemple, I would like to be able to do that :

subdomain1.example.com => 1.1.1.1:10
subdomain2.example.com => 1.1.1.1:11
subdomain3.example.com => 1.1.1.1:12

Can you tell me how ?

Thanks a lot

That is what virtual hosting is for, but that’s based on the hostname and not the port and you wouldn’t be able to proxy these ports, unless you are using the Tunnel product, which won’t be even necessary.

Unfortunately, virtual hosting is a rather generic topic and would be off-topic for here, so I’d recommend to check out the usual documentation and clarify any questions at StackExchange or Reddit.

Bottom line, your sites need to be working fine on HTTPS before you add anything to Cloudflare. Once they do you can add them to Cloudflare and it should work straight away.

1 Like

Maybe I explained it wrong, I have an EC2 instance, with a static ip.

I have granted outgoing access to 5 ports, which works well when I type the ip followed by the port, or via the domain name followed by port.

I want to be able to stop writting ports at the end of my domain name, but instead use a subdomain.

Thanks

No, you explained it all right, but my previous explanation did cover all aspects here. You don’t need to bother with ports, you need to configure your virtual hosting properly.

As I wrote

:point_down:

2 Likes

Ok, but I tried to find on the internet, but that’s why I’m writing here, I didn’t found how to do it.

I addressed that too.

General administration is unfortunately rather off-topic here. As I said, make sure your sites load fine on HTTPS without Cloudflare, then they will on Cloudflare too.

Virtual hosting - Wikipedia is a good start.

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