meteor - Meteor up - two apps running one virtual server
问题描述
I'm trying to run two meteor apps on one VPS machine using the Reverse Proxy setup with meteor-up. According to MUP everything is working fine, however, I can only load one of the websites. Both websites run independently on separate VPS machines and there are no errors when I deploy the app to the same server using MUP.
I've set both DNS to the same server 11.11.11.111
, is this the problem. Port 80 and 443 are open.
The website that won't load states Your connection is not private
.
Here are my what my mup files look like.
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
}
}
};
UPDATE
=> 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 部分更改为 Full。
我还清除了 Mac 上的 DNS 缓存,但我认为这与解决方案没有任何关系。 刷新 mac DNS 缓存。
推荐阅读
- r - 可以在 R 中读取 .wma 声音文件吗?
- c++ - g++ 内联调用 always_inline "int _rdrand16_step()" 失败
- java - HttpHeaders getFirst() 不区分大小写
- javascript - 当我尝试使用 window.print() 打印两个或更多文档时,只有第一个显示内容
- mongodb - mgo golang 不使用 $set 更新空数组
- python - 在 Python 中搜索加载的文件
- windows - 如何在使用批处理文件对文本进行排序和求和时忽略第一和第三数据列?
- entity-framework-core - Entity Framework .Core 将外键视为主键
- python - 课堂内的Tensorflow图 - 如何管理会话和范围
- ef-core-2.1 - DbContext.Query 上的 EF Core 2.1 InvalidCastException
()