Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
nginx中使用meteor的ssl和https_Ssl_Nginx_Meteor_Meteor Up - Fatal编程技术网

nginx中使用meteor的ssl和https

nginx中使用meteor的ssl和https,ssl,nginx,meteor,meteor-up,Ssl,Nginx,Meteor,Meteor Up,我有这个nginx配置 server { listen 80; server_name app.com www.app.com; rewrite ^ https://$server_name$request_uri? permanent; } server { listen 443; server_name app.com www.app.com; ssl on; ssl_certificate /etc/nginx/ssl/app.crt; ssl_cert

我有这个nginx配置

server {
  listen 80;
  server_name app.com www.app.com;
  rewrite ^ https://$server_name$request_uri? permanent;
}

server {
  listen 443;
  server_name app.com www.app.com;

  ssl on;
  ssl_certificate /etc/nginx/ssl/app.crt;
  ssl_certificate_key /etc/nginx/ssl/server.key;

  location = /favicon.ico {
    root /opt/myapp/app/programs/web.browser/app;
    access_log off;
    expires 1w;
  }

  location ~* "^/[a-z0-9]{40}\.(css|js)$" {
    root /opt/myapp/app/programs/web.browser;
    access_log off;
    expires max;
  }

  location ~ "^/packages" {
    root /opt/myapp/app/programs/web.browser;
    access_log off;
  }

  location / {
    proxy_pass http://localhost:3000;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;
  }
}
并使用具有正常设置的mup部署到ec2

它已部署,我可以访问网站
app.com

但是
https://app.com
不工作

正如在配置文件中一样,所有请求都被重写为
https
这里发生了什么

  • 当我进入app.com时,我可以访问该网站,这意味着它是 转发app.com广告
  • 我无法访问,这意味着nginx不工作
以上两种情况中哪一种是正确的

我别无选择。我用ssl检查器检查过,它们显示未安装ssl证书


那么,为什么我的应用程序在进入app.com时工作?

我对NGINX不了解,但看看我的工作生产配置,我看到了一些您没有包含在您的配置中的参数

为了代理websocket连接,您可能特别需要在顶部显示以下内容:

map $http_upgrade $connection_upgrade {
    default upgrade;
    ''      close;
}
我的443服务器除了您已有的以外,还包括以下内容:

server {
  ssl_stapling on;
  ssl_session_cache shared:SSL:10m;
  ssl_session_timeout 5m;
  ssl_prefer_server_ciphers on;
  ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  add_header Strict-Transport-Security "max-age=31536000;";
  location / {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto http;
    proxy_set_header X-Nginx-Proxy true;
    proxy_redirect off;
  }
}

最后,我将尝试注释出您的位置指令以进行错误检查。问题不应与SSL证书有关,它仍应允许您访问(带有警告)自签名或配置错误的证书。希望这有帮助。

现在Meteor Up已经内置了。不要再辛苦了

只需添加SSL证书和密钥,然后执行
mup设置

我们使用终止SSL


也许您应该尝试群集:。我没有亲自尝试过,但阿鲁诺达在类似问题上做了很多很好的工作。