Point domain to Container

Admiral Awesome

New Member
Feb 22, 2022
4
1
3
36
Hi,

is there a way to point domain to a given Container or VM inside pve IP address?

Theoretically what I want to do:

I have 1 external IP address of my PVE node.
I've got 2 containers with some websites on them.
I've got two different domains. I want to point domain A to container A and domain B to container B.

That's it.
Thank you in advance for any ideas.
 

oguz

Proxmox Staff Member
Staff member
Nov 19, 2018
5,002
631
118
hi,

I have 1 external IP address of my PVE node.
I've got 2 containers with some websites on them.
I've got two different domains. I want to point domain A to container A and domain B to container B.
if you have a single public IP address on your PVE, then that's the only IP address you can put inside your DNS records for the domains (since the internal IPs of your containers are not accessible by clients on external internet).

for that to work you'll have to do port forwarding on your PVE host, basically to forward all the packets coming to a specific port on your PVE host's public IP to the internal IP address of the container or VM [0].

if you want it all to run transparently on a single port (like 80 or 443, or both), then you will have to either
* host the sites from the same container
* use a reverse proxy (such as nginx, running in a separate CT/VM) to handle redirecting to the virtual hosts inside separate containers

hope this helps!

[0]: https://pve.proxmox.com/wiki/Networ...ith_tt_span_class_monospaced_iptables_span_tt
 
  • Like
Reactions: Admiral Awesome

Admiral Awesome

New Member
Feb 22, 2022
4
1
3
36
So I need to point my external IP to the Container with for example NGinx, that will take care of my internal redirections, correct?
 

oguz

Proxmox Staff Member
Staff member
Nov 19, 2018
5,002
631
118
So I need to point my external IP to the Container with for example NGinx, that will take care of my internal redirections, correct?
yes, it could be something like this:

yourdomain1.com and yourdomain2.com resolves to your PVE IP

let's assume your internal range is 192.168.1.0/24, and your nginx container is running on 192.168.1.100

webserver for yourdomain1.com running on 192.168.1.101, and yourdomain2.com 192.168.1.102

external internet ----> yourdomain1.com:80 or yourdomain1.com:443 ----> port forward to 192.168.1.100:80 / 192.168.1.100:443 respectively ----> nginx reverse proxy handles vhost for yourdomain1.com and yourdomain2.com to respective containers
 
Last edited:
  • Like
Reactions: Admiral Awesome

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!