流星雨-两个应用程序运行一台虚拟服务器

时间:2018-09-19 02:50:57

标签: meteor meteor-up mup

我正在尝试使用带有流星的反向代理设置在一台VPS计算机上运行两个流星应用程序。根据MUP的说法,一切正常,但是,我只能加载其中一个网站。这两个网站都在独立的VPS计算机上独立运行,当我使用MUP将应用程序部署到同一服务器时,没有错误。

我已将两个DNS都设置到同一服务器11.11.11.111,这是问题所在。端口80和443已打开。

将不会加载状态Your connection is not private的网站。

这是我的Mup文件的外观。

App1:mup.js

module.exports = {
  servers: {
    one: {
      host: '11.11.11.111',
      username: 'myuser',
      pem: 'key'
    }
  },

  app: {
    name: 'App1',
    path: '../',

    docker: {
      image: 'abernix/meteord:node-8.4.0-base',
    },

    // list of servers to deploy to, from the 'servers' list
    servers: {
      one: {},
    },

    // All options are optional.
    buildOptions: {
      // Set to true to skip building mobile apps
      // but still build the web.cordova architecture. (recommended)
      serverOnly: true,
      debug: false,
    },
    env: {
      // If you are using SSL, this needs to start with https
      ROOT_URL: 'https://app1.com',
      MONGO_URL: 'myMonogoDBlink'
    },

    enableUploadProgressBar: true, // default false.
  },

  proxy: {
    domains: 'app1.com, www.app1.com',
    ssl: {
      // Enable let's encrypt to create free certificates
      letsEncryptEmail: 'me@app1.com',
      forceSSL: true
    }
  }
};

App2:mup.js

module.exports = {
  servers: {
    one: {
      host: '11.11.11.111',
      username: 'myuser',
      pem: 'key'
    }
  },

  app: {
    // TODO: change app name and path
    name: 'App2',
    path: '../',

    servers: {
      one: {},
    },

    buildOptions: {
      serverOnly: true,
      debug: false,
    },

    env: {
      ROOT_URL: 'https://www.app2.com',
      MONGO_URL: 'myMonogoDBlink',
    },

    docker: {
      image: 'abernix/meteord:node-8.4.0-base',
    },

    enableUploadProgressBar: true
  },
  proxy: {
    domains: 'app2.com,www.app2.com',

    ssl: {
      // Enable Let's Encrypt
      letsEncryptEmail: 'me@app1.com',
      forceSSL: true
    }
  }
};

更新

=> Servers
  - 11.11.11.11: Ubuntu 16.04

=> Docker Status
 - 11.11.11.11: 18.06.1-ce Running

=> Meteor Status
 - 11.11.11.11: running 
    Created at 2018-09-19T12:16:33.361397945Z
    Restarted 0 times
=> Reverse Proxy Status
 - 11.11.11.11:
   - NGINX:
     - Status: running
     - Ports:
       - HTTPS: 443
       - HTTP: 80
   - Let's Encrypt
     - Status: running

1 个答案:

答案 0 :(得分:0)

好的,我想我已经缩小了范围,找到了解决方案。

我正在使用Cloudflare,并且我的DNS上附有规则,以将所有流量推送到www。加密SSL部分似乎是发生问题的地方。它设置为灵活。这似乎导致我的连接在http和https之间跳动。

有效的解决方案是将Cloudflare中的crypto SSL部分更改为Full。

我还清除了Mac上的DNS缓存,但我认为这与解决方案无关。 Flush mac DNS cache