【问题标题】:Multiple Domains for the same Meteor App - how to get the URL同一个 Meteor 应用程序的多个域 - 如何获取 URL
【发布时间】:2015-10-20 22:54:24
【问题描述】:

我需要在多个域(例如 customer1.com 和 customer2.com)上提供一个流星应用程序,并且根据它运行的域,它应该提供不同的 css 文件并稍微改变它的行为。

我使用 nginx 作为代理将所有传入的流量(除了一些特殊的子域)转发到这个 webapp。

(如何) 是否有可能获取在流星内部访问应用程序的 URL?

【问题讨论】:

    标签: meteor nginx


    【解决方案1】:

    如果你使用iron-router,你可以从请求对象中获取主机

    Router.route('/testHost', function() {
      this.response.end(this.request.headers.host);
      //the page will print out something like 127.0.0.1:3000 
    }, {where: 'server'});
    

    【讨论】:

      猜你喜欢
      • 2019-07-12
      • 1970-01-01
      • 2019-05-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-12
      • 2011-09-09
      • 1970-01-01
      相关资源
      最近更新 更多