Reverse proxy for VMs

egrueda

Renowned Member
Nov 9, 2010
47
0
71
Madrid, Spain
Hi all.
I'm playing with a Proxmox VE dedicated server. This server has just one public IP, so all VMs are using privated IPs (192.168.1.x) and MASQUERADE on proxmox host.

I want to access several name-based virtual hosts in several virtual machines, so I need this configuration:

Code:
www.example1.com => proxmox.example.com (11.22.33.44) => Virtual Machine A (192.168.1.11)
www.example2.com => proxmox.example.com (11.22.33.44) => Virtual Machine A (192.168.1.11)
www.example3.com => proxmox.example.com (11.22.33.44) => Virtual Machine B (192.168.1.12)

see? a single public IP which reverse-proxies all HTTP requests to their corresponding virtual machine.
I'm using nginx, which listens on public port 80 and acts as a reverse proxy, as nginx supports name-based vhosts.

Ayway I'm having some problems to make it work correctly.
Someone of you is using or has used this same method? any nginx + nat solution?
Thanks!
 
Hi all.
I'm playing with a Proxmox VE dedicated server. This server has just one public IP, so all VMs are using privated IPs (192.168.1.x) and MASQUERADE on proxmox host.

I want to access several name-based virtual hosts in several virtual machines, so I need this configuration:

Code:
www.example1.com => proxmox.example.com (11.22.33.44) => Virtual Machine A (192.168.1.11)
www.example2.com => proxmox.example.com (11.22.33.44) => Virtual Machine A (192.168.1.11)
www.example3.com => proxmox.example.com (11.22.33.44) => Virtual Machine B (192.168.1.12)

see? a single public IP which reverse-proxies all HTTP requests to their corresponding virtual machine.
I'm using nginx, which listens on public port 80 and acts as a reverse proxy, as nginx supports name-based vhosts.

Ayway I'm having some problems to make it work correctly.
Someone of you is using or has used this same method? any nginx + nat solution?
Thanks!
Hi,
i use pound for things like that (but not for proxmoxstuff).
This example is for URL-Based reverse-proxying:
Code:
ListenHTTP
        Address IP.ADD.RES.S
        Port    80 
        xHTTP 0
        Service
                HeadRequire "Host: *.www.domain.*"
                URL ".*WebContent//*"
                BackEnd
                        Address 192.168.99.5
                        Port    80
                End
        End
        # anything else local
        Service
                HeadRequire "Host: *.www.domain.*"
                URL ".*"
                BackEnd
                        Address 127.0.0.1
                        Port    8080
                End
        End
End
Udo
 
Hi, Udo, thanks for your answer.
I've tried pound before, but was looking for a cached proxy so it's not valid for my needs.
Anyway when I tried pound is was a really quick and easy proxy (maybe even too simple) and worked perfectly ;-)
 

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!