让我们encryptionNginx无法识别的证书

我使用本指南成功创build了一些LE SSL证书。

但是,当我更新我的nginxconfiguration使用证书和redirect所有端口80stream量到443. http成功redirect到https,该网站不加载。 浏览器检测到我有一个有效的证书,但说我没有安全的连接。 这是我在/var/log/nginx/error.log

 2016/03/08 00:11:49 [error] 7301#0: *14 no "ssl_certificate" is defined in server listening on SSL port while SSL handshaking, client: 55.555.55.555, server: 0.0.0.0:443 

错误说我没有定义SSL证书,尽pipe我这样做。 这是我的configuration:

 server { listen 443 ssl; server_name cooldomain.pizza www.cooldomain.pizza ssl_certificate /etc/letsencrypt/live/cooldomain.pizza/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/cooldomain.pizza/privkey.pem; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH'; root /home/ubuntu/www/cooldomain-pizza; index index.php index.html index.htm; server_name cooldomain.pizza www.cooldomain.pizza; charset utf-8; location / { try_files $uri $uri/ =404; # Uncomment to enable naxsi on this location # include /etc/nginx/naxsi.rules } location ~ \.php$ { try_files $uri $uri/ =404; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } 

我使用Nginx 1.4.6运行Ubuntu 14.04。

任何想法发生了什么? 我不得不回滚SSL版本的网站,回到80端口。

您似乎在server_name指令末尾缺less分号。 我怀疑这是导致下面的行被解释为server_name指令的一部分,而不是一个新的指令。

我遇到过同样的问题。 这帮助了我

 default_server 

听取指令。