使用Homestead进行本地开发时,默认情况下 Homestead.yaml 中的IP设置为192.168.10.10
。具有多个应用程序的示例Homestead.yaml如下所示:
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
authorize: C:/Users/MyUser/.ssh/id_rsa.pub
keys:
- C:/Users/MyUser/.ssh/id_rsa
folders:
- map: C:/Users/MyUser/workspace/projects
to: /home/vagrant/Code
sites:
- map: app1.local
to: /home/vagrant/Code/app1/public
- map: app2.local
to: /home/vagrant/Code/app2/public
databases:
- homestead
variables:
- key: APP_ENV
value: local
然后,此IP用于主机文件:
192.168.10.10 app1.local
192.168.10.10 app2.local
假设我想为每个应用程序使用单独的IP。可能吗?我该怎么做?
答案 0 :(得分:0)
removeRange
以上内容将根据某个IP地址重定向。
请参阅:https://www.siteground.com/kb/how_to_redirect_all_visitors_except_your_ip_to_another_site/
*您可以根据自己的需要修改内容。这只是样品。