Ubuntu “中的参数数无效”;ssl“U证书”密钥;/etc/nginx/sites enabled/defaul中的指令

Ubuntu “中的参数数无效”;ssl“U证书”密钥;/etc/nginx/sites enabled/defaul中的指令,ubuntu,ssl,nginx,certificate,Ubuntu,Ssl,Nginx,Certificate,我已获得EV SSL证书。我正在学习如何在Ubuntu上使用我的NGINX证书的教程 当我尝试重新启动nginx时,我得到: **invalid number of arguments in "ssl_certificate_key" directive in /etc/nginx/sites-enabled/default 到目前为止我所做的: sudo nano /etc/nginx/sites-enabled/default upstream app { # Path to Un

我已获得EV SSL证书。我正在学习如何在Ubuntu上使用我的NGINX证书的教程

当我尝试重新启动nginx时,我得到:

**invalid number of arguments in "ssl_certificate_key" directive in   /etc/nginx/sites-enabled/default
到目前为止我所做的:

sudo nano /etc/nginx/sites-enabled/default


upstream app {
# Path to Unicorn SOCK file, as defined previously
server unix:/home/zhall/zoulfia/shared/sockets/unicorn.sock fail_timeout=0;
}

server {
listen 80;
server_name moneytree.space www.moneytree.space " " 178.62.19.65;
rewrite ^/(.*) https://moneytree.space/$1 permanent;
}

# HTTPS server

server {
listen 443;
server_name moneytree.space www.moneytree.space " " 178.62.19.65;
root /home/zhall/zoulfia/public;


ssl on;
ssl_certificate /home/zhall/moneytree.space.chained.crt;

**ssl_certificate_key /home/zhall/ moneytree.space.key**

ssl_session_timeout 10m;

ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
ssl_prefer_server_ciphers on;

location / {
try_files $uri $uri/ =404;
}
}
当我用--

在我的日志文件中--

一切对我来说都是新的,所以我需要你的帮助来解决这个问题。我做错了什么,最重要的是如何纠正这个错误

谢谢,,
Zoulfia

看起来您可能在
ssl\u certificate\u key
行的末尾缺少分号。

您在“/home/zhall/”和“moneytree.space.key”之间有一个空格,nginx请参阅2个参数,而不是一个。

由于ssl.conf文件中有一个“=”,我遇到了同样的错误

正确的

ssl_certificate_key '/etc/letsencrypt/live/mysite/privkey.pem';
不对

ssl_certificate_key =  '/etc/letsencrypt/live/mysite/privkey.pem';

我在ubuntu nginx中也遇到了同样的问题,感谢Joel C ssl_certificate_key path/to/certificate.crt;现在感谢我在一个有ssllab.com的网站上使用nginx cat godaddy-ca.crt>godaddy-chain.crt&&cat gd_bundle.crt>>godaddy-chain.crt,然后在nginx.conf ssl_certificate/path/to/godaddy-chain.crt中使用我感觉像个傻瓜吗。。。我欠你乔尔·乔尔·乔尔。非常感谢你
ssl_certificate_key '/etc/letsencrypt/live/mysite/privkey.pem';
ssl_certificate_key =  '/etc/letsencrypt/live/mysite/privkey.pem';