我有一个具有单个IP的VPS。VPS应该为3个网站提供服务。Site1-通过WordPress的www.domain.com。Site2-通过WordPress的sub.domain.com。Site3-通过侦听端口81的Docker容器内的NodeJS生成的anothersub.domain.com。Site1和Site2非常简单,只需设置虚拟主机即可。但是,如何为Site3设置Apache?请提供示例或正确的语法吗?
来自apache docs(https://httpd.apache.org/docs/current/vhosts/examples.html#proxy)
<VirtualHost *:*>
ProxyPreserveHost On
ProxyPass "/" "http://192.168.111.2/"
ProxyPassReverse "/" "http://192.168.111.2/"
ServerName hostname.example.com
</VirtualHost>
和为您的情况:
<VirtualHost *:80>
ProxyPreserveHost On
ProxyPass "/" "http://localhost:81/"
ProxyPassReverse "/" "http://localhost:81/"
ServerName hostname.example.com
</VirtualHost>
祝你好运!
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句