I have a Debian Vagrant box running a Nginx server which hosts two websites/services that should share data via JSON endpoints.
Websites are accessible with https://app.test
and https://cdn.app.test
from the browser of the Host MacOS system.
To do this I have setup config.vm.network "private_network", ip: "33.33.33.10"
in the Vagrantfile.
I have added to the /etc/hosts
file on MacOS:
33.33.33.10 app.test
33.33.33.10 cdn.app.test
I can access both domains from the Mac, that works.
However I cannot use curl https://cdn.app.test/
within the Vagrant box shell because the Domains won't be resolved.
Neither curl_init
or file_get_contents
work.
I guess the problem is that the Vagrant cannot see the MacOS hosts entries.
What is the right way to configure this dev system? What is the easy fix?