加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 运营中心 > Nginx > 正文

ruby-on-rails-使用Nginx和Puma在Ruby on Rails应用程序上启用SS

发布时间:2020-12-13 20:59:29 所属栏目:Nginx 来源:网络整理
导读:这是我的Nginx conf文件: upstream app { server unix:/home/deploy/example_app/shared/tmp/sockets/puma.sock fail_timeout=0;}server { listen 80; listen 443 ssl; # ssl on; server_name localhost example.com www.example.com; root /home/deploy/ex

这是我的Nginx conf文件:

upstream app {
  server unix:/home/deploy/example_app/shared/tmp/sockets/puma.sock fail_timeout=0;
}

server {

  listen 80;
  listen 443 ssl;
  # ssl on;
  server_name localhost example.com www.example.com;

  root /home/deploy/example_app/current/public;

  ssl_certificate /etc/letsencrypt/live/www.example.com/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/www.example.com/privkey.pem;

  try_files $uri/index.html $uri @app;

  location / {
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Host $host;
    proxy_redirect off;
    proxy_http_version 1.1;
    proxy_set_header Connection '';
    proxy_pass http://app;
  }

  location /.well-known { allow all; }

  location ~ ^/(assets|fonts|system)/|favicon.ico|robots.txt {
    gzip_static on;
    expires max;
    add_header Cache-Control public;
  }

  error_page 500 502 503 504 /500.html;
  client_max_body_size 4G;
  keepalive_timeout 10;
}

证书的路径是正确的,但是当我访问https://example.com时,它将永远加载.

我的SSL设置有问题吗?

最佳答案
尝试SSL checker检查SSL是否有问题.

它将验证您的服务器证书,并告诉您问题出在哪里.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读