【问题标题】:Installing SSL in nginx problems在 nginx 中安装 SSL 问题
【发布时间】: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;
#    }
}

【问题讨论】:

    标签: ssl nginx


    【解决方案1】:

    我今天花了很多时间在 nginx 上设置 SSL。我建议检查的第一件事是端口 443 是否从 www.checkmyports.net 之类的东西打开

    还有,你重启nginx的时候会报错吗?

    【讨论】:

    • 我已经弄清楚了,是的,它是端口 443。接受答案:)。
    • 伙计,我刚刚浪费了 3 个小时试图重新配置我的 nginx 以使 ssl 请求正常工作,并且 443 一直关闭。如果我能给你十个赞,我会这样做。
    猜你喜欢
    • 2015-12-05
    • 2016-11-22
    • 1970-01-01
    • 1970-01-01
    • 2015-10-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多