title: NextJs: set status code 404 without redirection
body: <p>I'm trying to resolve a specific requirement for our web app.
  We have a page 'Item' that in case of an item sold out should keep showing item but the page's response code must be set to 404.
  I'm trying something like that:</p>
  <p>in pages/[id]/Item.tsx:</p>
  <pre><code>static async getInitialProps(ctx) {
     //retrieve item
     if (item.isSoldOut) {
         ctx.res.statusCode = 404;
     }
     //all other stuff
  }
  </code></pre>
  <p>but it will automatically redirect to the homepage with status code 302.
  How to achieve this behavior?</p>