title: Digitalocean hosted node app 502 Bad Gateway for POST/GET
body: <p>I have node app hosted on digitalocean.</p>
  
  <p>In file /etc/nginx/sites-available/default I have written</p>
  
  <pre><code>server {
      listen 80;
  
      server_name dailymartbasket.in;
  
      location / {
          proxy_pass http://127.0.0.1:3000;
          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;
      }
  }
  </code></pre>
  
  <h1>Problem:</h1>
  
  <p>When I call my domain name in browser then angular app inside this node app gets loaded which is at / route. from angular app we are making some POST/GET calls to node app but it returns error for those routes</p>
  
  <p><code>Request URL:http://&lt;domainname&gt;/api/categories
  Request Method:GET
  Status Code:502 Bad Gateway
  Remote Address:&lt;droplet ip&gt;:80
  Referrer Policy:no-referrer-when-downgrade</code></p>
  
  <p>Please suggest what is wrong, I am pretty new to server hosting</p>