“我们很抱歉,但出了问题”:rails + nginx + puma + digitalocean + ssl

我刚刚在生产服务器上的rails应用上成功configuration了ssl,但是现在,当我尝试访问该网站时,我得到了“我们很抱歉,但出错了。 错误:

在这里输入图像说明

如果我通过不使用任何SSL设置禁用SSL,我的Rails应用程序将运行得很好。 只有当我使用SSL设置,我会有这个问题。 这表明我的Rails代码没有什么问题。

我已经检查了这些日志文件:“ production.log puma.access.log puma.error.log ”,但没有什么除了:

=== puma startup: 2017-02-08 21:18:32 +0000 === * Listening on unix:///home/deploy/apps/my_app/shared/tmp/sockets/my_app-puma.sock 

以下是我的nginx.conf设置:

 upstream myapp_puma { #server unix:/tmp/myapp_puma.sock fail_timeout=0; server unix:///home/deploy/apps/my_app/shared/tmp/sockets/puma.sock; } # for redirecting to https version of the site server { listen 80; rewrite ^(.*) https://$host$1 permanent; } # for redirecting to non-www version of the site server { listen 80; server_name my.my_app.com; rewrite ^(.*) http://my.my_app.com$1 permanent; } server { listen 443 default ssl; server_name my.my_app.com; root /home/deploy/apps/my_app/current/public; access_log /home/deploy/apps/my_app/current/log/nginx.access.log; error_log /home/deploy/apps/my_app/current/log/nginx.error.log info; ssl on; ssl_certificate /etc/letsencrypt/live/my.my_app.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/my.my_app.com/privkey.pem; ssl_session_timeout 5m; ssl_protocols SSLv2 SSLv3 TLSv1; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; location ^~ /assets/ { gzip_static on; expires max; add_header Cache-Control public; } try_files $uri/index.html $uri @myapp_puma; location @myapp_puma { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto https; proxy_redirect off; proxy_pass http://myapp_puma; } error_page 500 502 503 504 /500.html; client_max_body_size 4G; keepalive_timeout 10; }