title: How to deploy nextjs into a directory which is not a root directory
body: <p>Recently I learn something about nextjs because I want to make a site which SEO friendly by using React. Everything looks great until I ran into a problem.</p>
  
  <p>It's about how can I deploy nextjs app into a directory which is not a root directory, for example '/next'. I use a simple config for nextjs, use the default node server listen to 3000 port and then use nginx for reverse.</p>
  
  <p>next.config looks like :</p>
  
  <p><a href="https://i.stack.imgur.com/BBw2H.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BBw2H.png" alt="enter image description here"></a></p>
  
  <p>nginx conf :</p>
  
  <p><a href="https://i.stack.imgur.com/ExcGq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ExcGq.png" alt="enter image description here"></a></p>
  
  <p>When I access localhost:8080/next I got the 404 page which is provided by nextjs and the css or js is also 404. It seems like the config of nextjs or nginx is wrong.</p>