[英]Redirect my domain name to specific port
I currently have a website running under apache on my VPS, but i'm planning to run another website with NodeJS. 我目前在VPS上的apache下运行一个网站,但我计划使用NodeJS运行另一个网站。
Since apache runs on port 80 and NodeJS on port 3000 i was wondering how i could manage that when someone type the domain name domain.com, it binds to the port 3000 ? 由于apache在端口80上运行,而NodeJS在端口3000上运行,我想知道当有人键入域名domain.com时,该如何绑定到端口3000?
Also, is it possible that after the redirect on the browser it shows only http://domain.com and not http://domain.com:3000 ? 另外,是否有可能在浏览器上重定向后仅显示http://domain.com而不显示http://domain.com:3000 ?
Use ProxyPass: 使用ProxyPass:
<VirtualHost *:80>
ServerName domain.com
ProxyRequests Off
ProxyPass / http://domain.com:3000/
ProxyPassReverse / http://domain.com:3000/
</VirtualHost>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.