我刚刚在生产服务器上的rails应用程序上成功配置了ssl,但现在,当我尝试访问该网站时,我得到了#34;我们很抱歉,但出了点问题。"错误:
如果我通过不使用任何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;
}