title: Nginx SSL Certificate failed SSL: error:0B080074:x509 (Google Cloud)
body: <p>My server was hosted in Bluehost (Apache), the certificate was working fine. Now, I'm using Google Cloud for multiple pages in NodeJS on different port using <code>proxy_pass</code>. I am trying to configure the SSL but I have problems. I was looking for similar questions, but it still shows the same error. I created the key file following this <a href="https://gist.github.com/bradmontgomery/6487319" rel="nofollow noreferrer">link</a></p>
  
  <p><strong>/var/log/nginx/error.log</strong>:</p>
  
  <blockquote>
    <p>2015/07/08 10:47:20 [emerg] 2950#0: SL_CTX_use_PrivateKey_file("/etc/nginx/ssl/domain_com/domain_com.key") failed (SSL: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch)</p>
  </blockquote>
  
  <p>When I put on console:</p>
  
  <p><strong>openssl rsa -noout -modulus -in domain_com.key</strong> shows me this:</p>
  
  <pre><code>Modulus=D484DD1......512 characters in total......5A8F3DEF999005F
  </code></pre>
  
  <p><strong>openssl x509 -noout -modulus -in ssl-bundle.crt</strong>:</p>
  
  <pre><code>Modulus=B1E3B0A.......512 characters in total......AFC79424BE139
  </code></pre>
  
  <p>This is my Nginx setup:</p>
  
  <pre><code>server {
      listen 443;
      server_name www.domain.com;
  
      ssl_certificate /etc/nginx/ssl/domain_com/ssl-bundle.crt;
      ssl_certificate_key /etc/nginx/ssl/domain_com/domain_com.key;
  
      ssl on;
      ssl_session_cache builtin:1000 shared:SSL:10m;
      ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
      ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
      ssl_prefer_server_ciphers on;
  
      access_log /var/log/nginx/domain_com.access.log;
  
      location / {
         proxy_set_header                         Host $host;
         proxy_set_header X-Real-IP               $remote_addr;
         proxy_set_header X-Forwarded-For         $proxy_add_x_forwarded_for;
         proxy_set_header X-Forwarded-Proto       $scheme;
         proxy_pass                               http://localhost:8086;
         proxy_read_timeout                       90;
         proxy_redirect                           http://localhost:8086 https://www.domain.com;
      }
  }
  </code></pre>
  
  <hr>
  
  <p><img src="https://i.stack.imgur.com/XRuSe.png" alt="enter image description here"></p>
  
  <hr>