我正在尝试使用Meteor Up(mup)将Meteor应用程序部署到Amazon Web Services实例。我遵循了该指南https://sergelobatch.com/beginners-guide-to-deploying-a-meteor-app-to-an-aws-server-with-meteor-up/,该指南到目前为止已使我成功完成这一路障。
Mup设置和Mup部署均成功运行。通过浏览器访问ip后,我会收到拒绝连接错误。
流星版本1.5.4
杯1.4.5
这是我的mup.js
module.exports = {
servers: {
one: {
// TODO: set host address, username, and authentication method
host: '54.206.11.xx',
username: 'ubuntu',
pem: '~/.ssh/MyClient-Staging.pem'
// password: 'server-password'
// or neither for authenticate from ssh-agent
}
},
app: {
// TODO: change app name and path
name: 'MyClient',
path: '../',
servers: {
one: {},
},
buildOptions: {
serverOnly: true,
},
env: {
// TODO: Change to your app's url
// If you are using ssl, it needs to start with https://
ROOT_URL: 'http://54.206.11.xx',
MONGO_URL: 'mongodb://mongodb/meteor',
MONGO_OPLOG_URL: 'mongodb://mongodb/local',
},
docker: {
// change to 'abernix/meteord:base' if your app is using Meteor 1.4 - 1.5
// image: 'abernix/meteord:node-8.4.0-base',
image: 'abernix/meteord:base',
},
// Show progress bar while uploading bundle to server
// You might need to disable it on CI servers
enableUploadProgressBar: true
},
mongo: {
version: '3.4.1',
servers: {
one: {}
}
},
// (Optional)
// Use the proxy to setup ssl or to route requests to the correct
// app when there are several apps
// proxy: {
// domains: 'mywebsite.com,www.mywebsite.com',
// ssl: {
// // Enable Let's Encrypt
// letsEncryptEmail: 'email@domain.com'
// }
// }
};
在进一步检查中,似乎会出现将根URL强制为HTTPS的情况,我不确定这是怎么回事。
更新:
我现在正在使用Nginx来提供文件,以解决此https问题。现在的问题是,我只在实际应该看到我的应用程序的地方看到nginx欢迎页面。
这是我的网站已启用/配置
server {
listen *:80;
server_name mysite.com;
access_log /var/log/nginx/app.dev.access.log;
error_log /var/log/nginx/app.dev.error.log;
location ~* "^/[a-z0-9]{40}\.(css|js)$" {
root /opt/appName/app/programs/web.browser;
access_log off;
expires max;
}
location ~ "^/packages" {
root /opt/appName/app/programs/web.browser/packages;
access_log off;
}
location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header X-Forwarded-For $remote_addr;
}
}
在这里我可以看到docker容器正在运行。
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2e0124d3fb74 mup-mefleetclient:latest "/bin/sh -c 'bash $M…" 3 minutes ago Up 3 minutes 0.0.0.0:3000->80/tcp MyClient
b880f60e7758 mongo:3.4.1 "/entrypoint.sh mong…" 5 minutes ago Up 5 minutes 127.0.0.1:27017->27017/tcp mongodb
root@ip-172-31-4-125:/etc/nginx/sites-enabled#
答案 0 :(得分:0)
此问题的根源是在项目上安装了一个名为'force-ssl'的npm软件包。删除软件包可以解决该问题,并且可以在线查看该项目。