Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

invalid number of arguments in "ssl_certificate_key" directive in /etc/nginx/sites-enabled/defaul

Ask Question

I have got my EV SSL Certificate. I am following tutorials on how to use my certificate with NGINX on Ubuntu

When I am trying to restart my nginx, I get:

**invalid number of arguments in "ssl_certificate_key" directive in   /etc/nginx/sites-enabled/default

What I did so far:

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;

When i restart nginx with ---

sudo service nginx restart

In my log file ----

sudo nano /var/log/nginx/error.log, I get:
**invalid number of arguments in "ssl_certificate_key" directive in    /etc/nginx/sites-enabled/default

Everything is new to me so I need your help to solve this. What am I doing wrong and most importantly how to correct this mistake?

Thank you, Zoulfia

I was getting same issue in ubuntu nginx Thanks Joel C ssl_certificate_key path/to/certificate.crt; – Ramesh Chand Feb 4, 2016 at 6:41 Thanks Now I on A with ssllab.com using with nginx cat godaddy-ca.crt > godaddy-chain.crt && cat gd_bundle.crt >> godaddy-chain.crt then use in nginx.conf ssl_certificate /path/to/godaddy-chain.crt – Ramesh Chand Feb 4, 2016 at 6:50

I had this same error due to an "=" in the ssl.conf file.

Correct

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

Not Correct

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

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.