title: Cannot restart nginx with configure SSL certificate on Amazon EC2
body: <p>I followed <a href="https://knowledge.rapidssl.com/support/ssl-certificate-support/index?page=content&amp;id=SO17664" rel="nofollow">this tutorial</a> by <em>rapidssl.com</em> how to set up their SSL certificate. I did everything according to the article, but when I try to restart <code>nginx</code>, I get following error:</p>
  
  <pre><code>Restarting nginx: nginx: [emerg] SSL_CTX_use_PrivateKey_file("/etc/nginx/certs/website.co.private.key") failed (SSL: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch)
  nginx: configuration file /etc/nginx/nginx.conf test failed
  </code></pre>
  
  <p>I have in the <code>/etc/nginx/certs/</code> directory 2 files - <strong>website.co.crt</strong> and <strong>website.co.private.key</strong>.
  The content of the <strong>website.co.private.key</strong> file is the key that is generatet from the command</p>
  
  <pre><code>sudo openssl req -out CSR.csr -new -newkey rsa:2048 -nodes -keyout privateKey.key
  </code></pre>
  
  <p>In the <strong>website.co.crt</strong> file is the certificate that I received by email by <code>SSLRapid.com</code> + <code>Bundled CA Version (PEM)</code> - so basically, there are 3 blocks of certificates.</p>
  
  <p>What am I missing or what could be wrong? I've create the directory <code>/etc/nginx/certs/</code> as <code>sudo mkdir</code>, I did it also in my previous project and it was working, but not in here.</p>
  
  <p>It's causing me headache, I am fighting with this issue 2nd day already and no result so far. I'll be grateful for every help.</p>
  
  <p>Thank you</p>