There are 3 ways to define hosts
- The main
The recommended way is to use the
vvv-hosts is supported for backwards compatibility, and
vvv-init.sh can be used for edge circumstances.
When changing hosts, the Nginx config will need updating so that Nginx knows to listen for requests on those domains. If this isn’t done, the VVV dashboard will appear instead of the desired site. If the
vagrant-hostsupdater plugin is installed (See the requirements), this will also add the domain to your machine’s HOST file.
Always Reprovision on ChangesModifying a sites provisioner files, or
vvv-custom.yml, requires a reprovision to take effect. To do this run:
vagrant reload --provision
When adding a site in
vvv-custom.yml, add a hosts section listing the domains of that site. For example:
example: hosts: - example.com
This will map example.com to the example site, and update the HOST file on your machine.
VVV 1 added hosts using a file named
vvv-hosts, and VVV 2 continues support for this for backwards compatibility reasons. Place this as a text file with no file extension in a
provision subfolder, or in the root of the site.
Here’s an example that adds 2 domains: