Phunzor
2 months ago

[Homestead] Only showing contents of last site in yaml

Posted 2 months ago by Phunzor

So after buying a new PC, I've installed the most recent Homestead box, which goes fine. Nasty thing tho is that it only serves the contents of the last mapped site in homestead.yaml.

So my Homestead.yaml file contains this:

sites:
    - map: site1.test
      to: /home/vagrant/code/site1/public

sites:
    - map: site2.test
      to: /home/vagrant/code/site2/public

sites:
    - map: site3.test
      to: /home/vagrant/code/site3/public

Regardless of going to site1.test, site2.test or site3.test from my development machine, they all serve me the code from site3.test. When I reverse the order so that site1.test is last in the list, it will show the contents of site1.test, regardless of going to site1, 2 or 3 in the browser.

First thing that came to mind was the hostfile on Windows. But this is set-up properly like:

192.168.10.10   site1.test
192.168.10.10   site2.test
192.168.10.10   site3.test

Reloading homestead with vagrant reload --provision doesn't help either.

So investigating a bit further, I found out that only the last website from the homestead.yaml is created in the /etc/nginx/sites-available and sites-enabled folders. So ultimately it looks like HomeStead/Vagrant isn't setting up all the sites, but just the last in the list.

Please sign in or create an account to participate in this conversation.