【问题标题】:Ubuntu Nginx new ssl certificate not working?Ubuntu Nginx 新 ssl 证书不起作用?
【发布时间】:2015-07-02 19:35:30
【问题描述】:

我使用的是 ubuntu 14.04 和 nginx。

我刚刚生成了我的 csr,并从 comodo 购买了一个 EV SSL 证书。我的站点启用目录中的 .conf 文件是:

server {
    listen       80;
    server_name  example.com;
    return       301 https://www.example.com$request_uri;
}

server {
        listen 80;
        listen [::]:80;

        listen 443 ssl;

        root /var/www/example.com/public_html;
        index index.php index.html index.htm;

        server_name www.example.com;
        ssl_certificate /etc/nginx/ssl/example.crt;
        ssl_certificate_key /etc/nginx/ssl/example.key;

        location / {
                try_files $uri $uri/ /index.php?$args;
        }

   location ~ \.php$ {
                try_files $uri =404;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                include fastcgi_params;
        }
}

我重新启动了一个 nginx,但我的 http://www.example.com 只是超时,就好像我什么都没做一样。 nginx 日志中没有错误。我已经确认我的文件在正确的位置。我的 example.conf 文件中是否有任何内容阻止 https 工作?另外,comodo 向我发送了 4 个文件,我将它们全部连接到 example.crt 文件中,我应该将其连接到 .PEM 文件中吗?

我还使用以下命令确认 crt 和 key 文件匹配:

openssl x509 -noout -modulus -in example.crt | openssl md5

openssl rsa -noout -modulus -in example.key | openssl md5

这是我第一次尝试在 nginx 上安装 ssl 证书。此外,在 comodo 验证我的网站之前,该证书是临时证书。

【问题讨论】:

    标签: ubuntu ssl nginx ssl-certificate


    【解决方案1】:

    我发现了问题。我在 EC2 上,我的实例没有端口 443 的安全组。我设置了一个并重新启动,一切都很好。

    【讨论】:

    • 你是怎么设置的?
    猜你喜欢
    • 1970-01-01
    • 2013-12-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多