【发布时间】:2013-11-27 08:12:50
【问题描述】:
所以我无法让我的 ssl 证书在带有 nginx 的 rails 应用程序中正常工作。我是否需要使用站点可用文件夹,还是可以将所有证书信息粘贴在 /opt/nginx/conf/nginx.conf 文件中?目前,我的 nginx.conf 文件看起来像这样,但是当我尝试使用 https 访问该站点时,它不起作用。在此之前,我有另一个服务器块侦听端口 80,它适用于 http,但这个适用于 https 的服务器块不起作用。有什么想法吗?
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;
# }
}
【问题讨论】: