Using dynamic IP and reverse proxy for my VMs and Containers

heldmar

Member
Nov 3, 2021
17
1
8
45
Hi!

I have been using Proxmox for a while. I use it for my homelab, and I wish to be able to use my own domain (through subdomains) into my entire homelab, being able to access the different VMx and LXCs with subdomains, such as: subdomain1.domain.com --> LXC101, subdomain2.domain.com --> VM102, etc.

The 2 challenges are:

1) I have dynamic IP (and varies around each hour)
2) I am not sure how to set this up, although I have read a lot about rever-proxies, but none of these seem to adjust to my need.

The challenge #1, I think I was able to solve it, as I use no-ip.com free service. So, I already have a small LXC set up in my system with the no-ip client to automatically update the domain every 5 mins, so my IP varies but no-ip already points it automatically.

Then, I have my own domain set up in AWS, and I created a CNAME for subdomain1.domain.com to point to my no-ip domain, so every time my no-ip domain changes the CNAME gets updated (works most of the time, although it might have some delays sometimes).

Now, how can I make the proxmox cluster to reverse-proxy things up? Do I need to install a reverse proxy on the host machine (so, basically over proxmox)? I wouldn't want to install anything on top of proxmox, only within it with LXCs or VMs.

Thoughts?
 
Do you have a firewall that can do the port forwarding to this machine that you want to be accessible from the outside?

I have a lxc with reverseproxy installed, all calls on 80 and 443 is forwarded from my firewall to my lxc and in my reverseproxy I have the configuration files for the subdomains
 
I do have a router (actually is a network mesh) which would allow me to do port forwarding, yes.

Now, if I do that, from that reverseproxy-lxc can I just assign domains to point to my other LXCs and VMs in Proxmox? That's actually my question on this.

Also, what reverseproxy are you using?
 
I'm using nginx.

First you have to point the DNS of subdomains of your domain to your public IP.

Then the firewall/router had to port forward on the IP of the lxc and in lxc you have to create for every subdomain a file with the right configuration.

And the magic will be done :)

I'll send you an example of the configuration file from my nginx later if you want.
 
  • Like
Reactions: heldmar
OK, I think I will have to try it.

I would appreciate it if you could send me the conf file! :)

Let me know if you can post it here or if you prefer to use direct message instead.
 
Here you have one default config file...it's pretty simple the config file.
You have just to change the domain
 

Attachments

  • nginx default .txt
    805 bytes · Views: 30

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 yours easily in our online shop.

Buy now!