Listen 80
<VirtualHost *:80>
<Directory "E:\aaa" >
Order allow,deny
Allow from all
</Directory>
<Directory "E:\bbb" >
Order allow,deny
Allow from all
</Directory>
ProxyRequests off
<Proxy *>
<Location /aaa>
<Location /bbb>
</VirtualHost>
<VirtualHost *:80>
<Directory "E:\aaa" >
Order allow,deny
Allow from all
</Directory>
<Directory "E:\bbb" >
Order allow,deny
Allow from all
</Directory>
ProxyRequests off
<Proxy *>
Order allow,deny</Proxy>
Allow from all
<Location /aaa>
ProxyPass http://localhost:81</Location>
ProxyPassReverse http://localhost:81
<Location /bbb>
ProxyPass http://localhost:82</Location>
ProxyPassReverse http://localhost:82
</VirtualHost>
其中81、82分别为node开启的web系统,它们是服务器内部端口不对外,对外只有80端口。
配置完毕后,就可以通过如下地址访问内部系统:
http://[外网ip]/aaa
http://[外网ip]/bbb

本文介绍如何使用Apache配置代理,使外部可通过80端口访问位于不同内部端口(如81和82)的两个Node.js Web应用。通过设置Directory、Proxy及Location指令实现内外部端口映射。
配置多个虚拟目录,分别设置代理访问Node.js&spm=1001.2101.3001.5002&articleId=54140264&d=1&t=3&u=567887fdb9c747d9bbeb08a3697889b7)
495

被折叠的 条评论
为什么被折叠?



