代码之家  ›  专栏  ›  技术社区  ›  bp123

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

  •  1
  • bp123  · 技术社区  · 7 年前

    我正在尝试在一台VPS机器上运行两个Meteor应用程序,使用与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: J.J.

    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 回复  |  直到 7 年前
        1
  •  0
  •   bp123    7 年前

    好吧,我想我已经缩小了问题的范围,找到了解决办法。

    我正在使用CloudFlare,并且我的DNS上附加了一些规则,可以将所有流量推送到 www . 加密SSL部分似乎是出现问题的地方。它被设置为灵活的。这似乎导致了我的连接在HTTP和HTTPS之间来回切换。

    有效的解决方案是将CloudFlare中的crypto ssl部分更改为full。

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

    推荐文章