将本地主机8080和8000的无用端口转发到主机8080和8000

问题描述 投票:0回答:1

我正在使用Vagrant和Ansible在Centos7 VM上部署应用程序。我可以通过localhost:8080和localhost8000连接到VM上的应用程序。如何使用端口转发访问主机上的应用程序(例如,访问主机上的Web浏览器,并且可以通过localhost:8080和localhost:8000访问该应用程序)?

ansible vagrant port vagrantfile forwarding
1个回答
0
投票

您可以使用:

Vagrant.configure(“ 2”)做| config |config.vm.network“转发端口”,访客:80,主机:8080结束

有关更多信息,请参考:https://www.vagrantup.com/docs/networking/forwarded_ports.html

此后,如果您遇到任何问题。请让我知道。

© www.soinside.com 2019 - 2024. All rights reserved.