title: how to resolve nginx 502 bad-gateway error
body: <p>I've containerized the next.js web application and hosted in aws ec-2. using nginx as proxy server</p>
  <p>this is the only working page</p>
  <blockquote>
  <p>/</p>
  </blockquote>
  <p>not working for any other pages (paths),it throws <strong>502 bad-gate-way</strong></p>
  <p><em>EX:</em></p>
  <blockquote>
  <p>/etc</p>
  </blockquote>
  <blockquote>
  <p>/slug/page</p>
  </blockquote>
  <p>this is the nginx cofiguration</p>
  <pre><code>server {
  listen 80 default_server;
  
  
  location  / {
    proxy_pass http://localhost:300;
  }
  </code></pre>
  <p>}</p>
  <p>how can I Forward all paths to a specific port?</p>