Meteor up - 两个应用 运行 一个虚拟服务器

Meteor up - two apps running one virtual server

我正在尝试 运行 在一台 VPS 机器上使用带有 meteor-up 的反向代理设置来运行两个 meteor 应用程序。根据 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

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

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

有效的解决方案是将 Cloudflare 中的加密 SSL 部分更改为完整。

我还清除了 Mac 上的 DNS 缓存,但我认为这与解决方案没有任何关系。 Flush mac DNS cache.