es.example.app; you don't need to put each of them as a seperate entry to your both homestead config file and the hosts file if all of them will be served from the same application. There is of course an easier way.
Let's assume our application is located within the
~/Code/Examplefolder and we want to map it to
example.app, furthermore, the ip address assigned to our box is
$ nano ~/Homestead/Homestead.yamlThe most simple Homestead config will be like below.
---Then, ssh into your vagrant box and edit the
- map: ~/Code/Example
- map: example.app
$ cd ~/Homestead && vagrant up && vagrant sshAnd just add the wildcard entry to the server_name.
$ sudo nano /etc/nginx/sites-available/example.app
server_name example.app *.example.appAnd reload the nginx configuration.
$ sudo service nginx reloadThen on your local machine, add a dnsmasq entry.
$ sudo nano /etc/NetworkManager/dnsmasq.d/localJust add the entry below.
address=/example.app/192.168.10.10Finally, restart the network-manager.
$ sudo service network-manager restartNow everything should be ok. You don't need to add individual entries for each of the subdomains of your application. For instance, both en.example.app and es.example.app will be served without adding a seperate configuration for each.