VirtualBox 浏览后端服务器侦听特定端口
VirtualBox to browse a backend server listen on specific port
我的 Windows.
安装了 VirtualBox 和 Vagrant
机器启动...
vagrant up
;
;
homestead-7: 80 (guest) => 8000 (host) (adapter 1)
;
;
我成功浏览到我的站点如下:
http://test02.app:8000
我的 'Homestead.yaml' 文件包含以下站点:
sites:
- map: test01.app
to: /home/vagrant/sites/test01
- map: test02.app
to: /home/vagrant/sites/test02
- map: test03.app
to: /home/vagrant/sites/test03
我的 windows 主机文件包含以下内容:
127.0.0.1 test01.app
127.0.0.1 test02.app
127.0.0.1 test03.app
我有一个使用 Node.js 的基本 HTTP 服务器,它安装在这个文件夹 (test02/backend) 上,提供一些图像编辑器服务(dl、上传、img 等)。
服务器侦听端口 9006。
所以我想浏览如下:http://test02.app:8000:9006
这当然不行
使用此端口的我的站点 url 的语法是什么?
如果您要访问的服务器正在侦听端口 9006,您可以直接使用 http://test02.app:9006 访问它(确保服务器正在侦听 0.0.0.0 而不仅仅是 127.0.0.1)
如果你想访问网络服务器,你将达到 8000,网络服务器可以将请求转发到另一台服务器(这将是你的网络服务器的一些配置)
我的 Windows.
安装了 VirtualBox 和 Vagrant机器启动...
vagrant up
;
;
homestead-7: 80 (guest) => 8000 (host) (adapter 1)
;
;
我成功浏览到我的站点如下: http://test02.app:8000
我的 'Homestead.yaml' 文件包含以下站点:
sites:
- map: test01.app
to: /home/vagrant/sites/test01
- map: test02.app
to: /home/vagrant/sites/test02
- map: test03.app
to: /home/vagrant/sites/test03
我的 windows 主机文件包含以下内容:
127.0.0.1 test01.app
127.0.0.1 test02.app
127.0.0.1 test03.app
我有一个使用 Node.js 的基本 HTTP 服务器,它安装在这个文件夹 (test02/backend) 上,提供一些图像编辑器服务(dl、上传、img 等)。
服务器侦听端口 9006。
所以我想浏览如下:http://test02.app:8000:9006
这当然不行
使用此端口的我的站点 url 的语法是什么?
如果您要访问的服务器正在侦听端口 9006,您可以直接使用 http://test02.app:9006 访问它(确保服务器正在侦听 0.0.0.0 而不仅仅是 127.0.0.1)
如果你想访问网络服务器,你将达到 8000,网络服务器可以将请求转发到另一台服务器(这将是你的网络服务器的一些配置)