How to access Laravel Homestead on other devices?

Viewed 8017

My machine and Android devices are on the same network.

  • Machine IP: 192.168.0.11
  • The IP where Homestead is running: 192.168.10.10

If I enter 192.168.0.11:8000 on my Android device I can use only one site.

How can I enter all sites stored in Homestead?

This is my Homestead.yaml file:

---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/Homestead-Projects
      to: /home/vagrant/Homestead-Projects

sites:
    - map: site1.com
      to: /home/vagrant/Homestead-Projects/Site1/public
    - map: site2.app
      to: /home/vagrant/Homestead-Projects/Site2/public

databases:
    - homestead
    - db_site1
    - db_site2

variables:
    - key: APP_ENV
      value: local

# blackfire:
#     - id: foo
#       token: bar
#       client-id: foo
#       client-token: bar

# ports:
#     - send: 93000
#       to: 9300
#     - send: 7777
#       to: 777
#       protocol: udp

This is my hosts file:

127.0.0.1   localhost
127.0.1.1   host

#Virtual Hosts on Homestead
192.168.10.10   site1.com
192.168.10.10   site2.com

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
3 Answers

I believe this is the right answer acess homestead from external

all you need to just add default server on your nginx.conf

listen 80 default_server;
Related