title: How can I set the rootUrl to automatically to added to relative urls in next.js?
body: <p>I have the following:</p>
  
  <pre><code>&lt;img src="/productimages/5db35735eb03d2.46088954.jpg" /&gt;
  </code></pre>
  
  <p>This works fine locally, but once I build and deploy my Next.js project, then upload a new file to my deployed app without rebuilding then it does not work unless I specify the absolute path like this:</p>
  
  <pre><code>&lt;img src="http://mywebsite.com/productimages/5db35735eb03d2.46088954.jpg" /&gt;
  </code></pre>
  
  <p>Is there a way to tell Next.js that the relative path should behave as if its the absolute path?</p>
  
  <p>My current workaround is to add <code>window.location.origin</code> to all urls. </p>
  
  <p>But this does not work with some of my server rendered paths. I would rather not do that and also not have to rebuild every time I or someone uploads a new image.</p>