Associate a subdomain to a specific VM / Proxmox itself (Please explain how to do it) also add auto SSL for all subdomain just not the hole PVE

KnottyCord

Member
Oct 6, 2020
2
0
21
25
Hey!

I’m new to proxmox and I have some question.
First thing first is it possible to associate a subdomain to a specific VM. Currently I have 2 VM and 3 subdomains as a A record on my domain name. The first thing I would like to associate proxmox.domain.com to proxmox itself (Beauce domain.com is link to my EdgeRouter! Second, I want to associate games.domain.com to my gaming VM, and the last one is social.domain.com for my social program that I’m running. So, if someone knows how to do it please explain it so I can make it work! Thank you in advance.

The other thing I did is that I created an SSL using DigitalOcean DNS API to add SSL to my hole PVE. But I would also add it to all my subdomain. How do I do that, so it can renew automatically?

Thank you!
 
hi,

First thing first is it possible to associate a subdomain to a specific VM.
yes.

The first thing I would like to associate proxmox.domain.com to proxmox itself (Beauce domain.com is link to my EdgeRouter! Second, I want to associate games.domain.com to my gaming VM, and the last one is social.domain.com for my social program that I’m running. So, if someone knows how to do it please explain it so I can make it work! Thank you in advance.

it depends on your setup. if you have different public IPs for these VMs, then the process is basically the same. i don't know about the digitalocean API, but let's encrypt can be a good option.

you could generate either a wildcard certificate, like '*.domain.com' which would work for all subdomains. if you want to have separate certificates for them you need to generate a certificate for each VM. you can follow some guides online how to do this, as it's more of a general sysadmin question (nothing specific to proxmox here). after generating the certificates add them to your webserver (if you use certbot it can handle most of the configuration automatically as well)
 
The key is a reverse proxy. This way you can map different subdomains to different VMs using just a single public IP. You could for example run Nginx Proxy Manager in Docker to do this or use HAproxy if you need HA.