title: How to force HTTPS in nextjs App without creating a custom server
body: <p>Does someone know how to force HTTPS in nextjs without creating a custom server?</p>
  <p>UPDATE 1:</p>
  <p>my current solution is by doing this in a HOC:</p>
  <pre><code>  useEffect(() =&gt; {
      if (window.location.protocol !== 'https:'
       &amp;&amp; process.env.NODE_ENV !== 'development') router.push(process.env.NEXT_PUBLIC_FRONT_BASE_URL + window.location.pathname);
    }, [])
  </code></pre>
  <p>i'm hoping to find a better way.</p>
  <p>UPDATE 2:</p>
  <p>i ended up switching to Vercel, i found it much better than heroku.</p>