1.肯定是先配hosts,例如我本机配了www.test.com

2.在conf\extra\httpd-vhosts.conf中配置:

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.localhost
ServerName www.test.com
ProxyRequests off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://127.0.0.1:1337/
ProxyPassReverse / http://127.0.0.1:1337/
</VirtualHost>

3.用到了vhosts.conf嘛,所以在\conf\httpd.conf中将conf/extra/httpd-vhosts.conf给include上,又因为用到proxy,所以在\conf\httpd.conf中还要将proxy相关模块加上(默认是注释掉的),例如proxy_module modules/mod_proxy.so。

然后就可以通过www.test.com访问nodejs在1337接口创建的服务啦。

相关文章:

  • 2021-09-10
  • 2021-06-10
  • 2021-06-28
  • 2021-12-23
  • 2022-12-23
  • 2021-11-28
  • 2022-12-23
  • 2022-02-23
猜你喜欢
  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
  • 2022-12-23
相关资源
相似解决方案