[英]How can i link two NodeJS servers under one domain?
for example i have a website that hosts a messenger app, it's written using Node JS on the back-end and has a server running on an obscure port (port 3455)例如,我有一个托管 Messenger 应用程序的网站,它是在后端使用 Node JS 编写的,并且有一个服务器在一个不起眼的端口(端口 3455)上运行
Currently my domain is being used to host my portfolio under a different port.目前,我的域被用于在不同的端口下托管我的投资组合。 the domain would be:
域将是:
mydomain.com/
Is there anyway i could make it so that the app using port 3455 connects when i visit:无论如何我可以做到,以便在我访问时使用端口 3455 的应用程序连接:
mydomain.com/messengerapp
even better would i be able to create a subdomain so its:更好的是我能够创建一个子域,因此它:
messenger.mydomain.com
You can achieve this by 301 redirection code.您可以通过 301 重定向代码实现此目的。 If you have apache server, add redirection rule to .htaccess and if you have nginx server, add redirection rule to its config file.
如果你有 apache 服务器,将重定向规则添加到 .htaccess 并且如果你有 nginx 服务器,将重定向规则添加到其配置文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.