VMware Cloud Community
Mortred
Contributor
Contributor

Using Nginx with Vsphere

Hi experts,

I have 2 vsphere 6.5.0 hosts, eg 10.1.1.1 & 10.1.1.2

Now, I need to access the vsphere hosts via sub-url. eg:

1. https://lab.domain.com/vm1 -----> 10.1.1.1

2. https://lab.domain.com/vm2 -----> 10.1.1.2

Plz note that:
1. I have no vCenter servers and not plan to purchase it since we are a running small business

2. Due to some limtation, I don't have multiple domains (even have no sub-domains). In this case, I have to use sub-url to identify different vsphere hosts

Thanks in advance

Tags (1)
Reply
0 Kudos
6 Replies
daphnissov
Immortal
Immortal

You need vCenter as a central management tool. It is not a tool only for large enterprises. The is no built-in way otherwise to accomplish this. As to using Nginx, this is a VMware forum. You may have better luck asking on an Nginx one.

nettech1
Expert
Expert

Based on your post I am gonna assume you are using the free version of esxi.

Have you looked at the basic license VMWare offers? This level does not include tech support free of charge, but you will get vCenter server Essentials and will be able to back up your VMs with backup software that integrates with vcenter.

“vSphere Essentials Kit is an all-in-one solution ideal for small offices. It enables consolidation and management of applications to reduce hardware and operating costs—all with a low upfront investment. Essentials must be purchased along with a one-year subscription to software patches and updates. Support is optional and available on a per-incident basis.”

Reply
0 Kudos
sk84
Expert
Expert

You don't need sub urls or sub domains. You just need 2 DNS entries (A records) in the domain "domain.com" pointing to ip addresses of your ESXi hosts.

For example:

host1.domain.com --> 10.1.1.1

host2.domain.com --> 10.1.1.2

You could also buy a domain somewhere and set these entries yourself, if this is not possible with your provider or in your company.

If necessary, you can even change the hosts file in your computer and configure these entries there. But this will only work for the computer where the hosts file was modified.

--- Regards, Sebastian VCP6.5-DCV // VCP7-CMA // vSAN 2017 Specialist Please mark this answer as 'helpful' or 'correct' if you think your question has been answered correctly.
Reply
0 Kudos
nettech1
Expert
Expert

2 DNS entries (A records) in the domain "domain.com" pointing to ip addresses of the ESXi hosts with result in round-robin DNS and the original poster will have 50% change of this solution working.

Reply
0 Kudos
sk84
Expert
Expert

2 DNS entries (A records) in the domain "domain.com" pointing to ip addresses of the ESXi hosts with result in round-robin DNS and the original poster will have 50% change of this solution working.

If the A records are identical, then yes. That's why I used A records for "host1" and "host2" in my example and not for "lab". 😉

--- Regards, Sebastian VCP6.5-DCV // VCP7-CMA // vSAN 2017 Specialist Please mark this answer as 'helpful' or 'correct' if you think your question has been answered correctly.
Reply
0 Kudos
kenbshinn
Enthusiast
Enthusiast

I am a little confused as to why you would be using ngnix to load balance connections to 2 ESXi hosts? Wouldn't that mean if you try to go to that sub url that it will round robin the connection between the 2 hosts? I can understand doing it with vCenter, which I think is the way that you need to go with this if you want to be able to manage both ESXi Hosts from a Single URL (and Load Balance it)

Reply
0 Kudos