vagrant configure port forwarding

In general we win by vagrant as a development environment, it is to communicate through port mapping,

In the vagrant profile vagrantfile can be seen in the following configuration

 

 

 Probably it means the access to port 8080 on the host machine to forward requests on port 80 service virtual machines, as follows:

 

 Restart vagrant

 

 We can see just added

 

Generally, we all want to access through a unified port 80

vagrant site unified configuration 80 port

First, add a line in the Vagrantfile vagrant

  config.vm.network "forwarded_port", guest: 80, host: 80, host_ip: "127.0.0.1",id:"http"

Then nginx configuration (the configuration procedure is not expanded)

 

Then modify the  hosts file

 

 

 

 Save and restart

 

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/jxxiaocao/p/12098406.html