这是我的流浪文件:
Vagrant.configure("2") do |config|
config.vm.define "m1" do |m1|
m1.vm.box = "centos/7"
m1.vm.box_check_update = false
m1.vm.hostname = "vagrant-m1"
m1.vm.network "private_network", ip: "10.220.59.61"
m1.vm.network "forwarded_port", guest: 80, host: 80
m1.vm.network "forwarded_port", guest: 3306, host: 3306
m1.vm.provision :shell, path: "bootstrap.sh"
m1.vm.synced_folder "~/Working/source", "/vagrant", type: "nfs"
m1.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "8192"]
end
end
end
我正在尝试设置静态 IP 10.220.59.61。之后vagrant ssh
,我设置了 nginx 并将虚拟主机设置为test.local
。我从 vagrant box 中添加了主机和curl test.local
,并且成功了。
但是,如果我从我的 Mac 添加一个主机10.220.59.61 test.local
,然后从浏览器访问它,则需要超过 30 秒才会显示超时错误。
我尝试关闭所有防火墙,但没有任何效果。我该如何操作?