在vagrant配置文件vagrantfile中可以看到如下配置
config.vm.network "forwarded_port", guest: 80, host: 8080
这一行的意思就是把对host机器上8080端口的访问请求forward到虚拟机的80端口的服务上,如果要再添加一个端口转发
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.network "forwarded_port", guest: 8181, host: 8181
网友评论