Meteor.JS 的两个实例,子域 [英] Two instances of Meteor.JS, subdomains

查看:54
本文介绍了Meteor.JS 的两个实例,子域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何运行两个流星实例,每个实例在不同域(例如:foo.com 和 tree.com)的同一服务器上都有自己的应用程序?

How can I run two instance of meteor, each with it's own application on the same server on a different domain (ex: foo.com and tree.com)?

我目前能想到的最可行的选择是使用不同的端口,并在 nginx 中重定向到 localhost 上的这些端口.之后我为 Meteor 设置了正确的绝对路径.

The most viable option I currently can think of is to use different ports and have a redirect in nginx to those ports on localhost. Afterwards I set the correct absolutePath for Meteor.

不使用例如 nginx 的任何其他选项?

Any other options without using for example nginx?

推荐答案

Meteor 目前不处理 http 主机头来区分两个应用程序.如果你真的想使用同一台机器,你就必须在不同的端口上运行不同的实例.

Meteor currently doesn't process the http host header to distinguish between two applications. You would have to run different instances on different ports if you really want to use the same machine.

这取决于你把它放在什么上面.任何通过主机头来代理识别请求的数据都是你最好的选择(nginx),

It depends on what you're putting this on. Anything to proxy the data identifying the request via the host header is your best bet (nginx),

此外,您可以自定义 node.js 应用程序(类似循环的应用程序)来正确代理数据,看看另一个问题

Additionally, you could a custom node.js app (a round-robin like app) to proxy the data correctly, have a look at another question

Node.js 是否支持跨服务器的多个负载均衡?

如果您不想使用 nginx,请将端口修改为您想要的并在 http 主机属性中添加条件.

and modify the ports to what you want and add in a condition on the http host property, if you don't want to use nginx.

这篇关于Meteor.JS 的两个实例,子域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆