I have a Ubuntu VM machine I'm running through Vagrant with
nginx installed. It's pretty easy to ssh into the VM and setup a new nginx vhost whenever I need one. But what is the best practice for setting up nginx vhosts via Vagrant provisioning, or maybe using Puppet? Essentially I imagine some sort of config file(s) that sit in my host folder and when I provision, it parses these config files and creates a new vhost for me on the VM.
With this you will be able to set anything you need on the vagrant VM.
There is a vagrant plugin - hostupdater. It can automatically update /etc/hosts and add virtual hosts pointing to your guest machine
Vagrant file configuration example:
config.vm.network :private_network, ip: "192.168.3.10" config.vm.hostname = "www.testing.de" config.hostsupdater.aliases = ["alias.testing.de", "alias2.somedomain.com"]