所以我无法让我的 ssl 证书在带有 nginx 的 Rails 应用程序中正常工作。我是否需要使用 sites-available 文件夹,或者我是否可以将所有证书信息粘贴到/opt/nginx/conf/nginx.conf 文件中?目前,我的 nginx.conf 文件看起来像这样,但是当我尝试使用 https 访问该站点时它不起作用。在此之前,我有另一个监听端口 80 的服务器 block ,它适用于 http,但这个适用于 https 的 block 不起作用。有什么想法吗?
server {
listen 443;
server_name www.mysite.com;
#localhost;
ssl on;
ssl_certificate reference to my pem file
ssl_certificate_key reference to my key file
root reference to app in /var/www
# ssl on;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_timeout 5m;
# ssl_protocols SSLv2 SSLv3 TLSv1;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
}
最佳答案
我今天花了很多时间在 nginx 上设置 SSL。我建议首先检查端口 443 是否已从 www.checkmyports.net 之类的网站打开
还有,请问重启nginx会不会报错?
关于ssl - 在 nginx 问题中安装 SSL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20237032/