这是我的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...
这是我的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是否有问题.
它将验证您的服务器证书,并告诉您问题出在哪里.
沃梦达教程
本文标题为:ruby-on-rails-使用Nginx和Puma在Ruby on Rails应用程序上启用SSL
猜你喜欢
- 汇编语言程序设计之根据输入改变屏幕颜色的代码 2023-07-06
- Swift超详细讲解指针 2023-07-08
- Go Web开发进阶实战(gin框架) 2023-09-06
- Ruby 迭代器知识汇总 2023-07-23
- Golang http.Client设置超时 2023-09-05
- Ruby的字符串与数组求最大值的相关问题讨论 2023-07-22
- Ruby on Rails在Ping ++ 平台实现支付 2023-07-22
- R语言-如何切换科学计数法和更换小数点位数 2022-11-23
- R语言关于二项分布知识点总结 2022-11-30
- R语言绘图数据可视化pie chart饼图 2022-12-10