title: NGINX cannot forward https POST request to another port
body: <p>I am running a NodeJS application and deployed using pm2 running on port 5000, this works fine with http requests. To get the https working I have created a reverse proxy in nginx to forward https request on port 5001 to forward to port 5000. It works fine if I disable the SSL, http request is correctly forwarded from port 5001 to port 5000 but https works only for GET method, but not for POST method.</p>
  
  <pre><code>server {
      listen 5001 default_server;
  
  
      ssl on;
      ssl_certificate /home/ubuntu/xyz.crt;
      ssl_certificate_key /home/ubuntu/xyz.key;
      server_name mydomain.com www.mydomain.com;
  
      root ~/mynodeapp; location / {
          proxy_pass http://127.0.0.1:5000;
          proxy_http_version 1.1;
          proxy_set_header Upgrade $http_upgrade;
          proxy_set_header Connection 'upgrade';
          proxy_set_header Host $host;
          proxy_cache_bypass $http_upgrade;  proxy_buffering off; 
          proxy_set_header        Host            $host;
          proxy_set_header        X-Real-IP       $remote_addr;
          proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
  
      } 
  </code></pre>
  
  <p>I need to be able to call my API endpoint running on port 5000 over SSL through port 5001</p>