title: nginx - custom 404 - css / js not found
body: <p>I have an nginx server running with </p>
  
  <pre><code>error_page 404 /404.html;
  location = /404.html {
          root /usr/share/nginx/html;
          internal;
  }
  
  error_page   500 502 503 504  /50x.html;
  location = /50x.html {
          root   /usr/share/nginx/html;
          internal;
  }
  </code></pre>
  
  <p>The error pages are well displayed as long as the url is "<a href="http://domain/not_existing_page.html" rel="nofollow">http://domain/not_existing_page.html</a>". 
  However if it is like "<a href="http://domain/subpath/not_existing_page.html" rel="nofollow">http://domain/subpath/not_existing_page.html</a>", my CSS and JS are not retrieved.</p>
  
  <p>Indeed, in my 404.html the link</p>
  
  <pre><code>&lt;link href="css/custom.css" rel="stylesheet"&gt;
  </code></pre>
  
  <p>doesn't work as the browser looks for "<a href="http://domain/subpath/css/custom.css" rel="nofollow">http://domain/subpath/css/custom.css</a>".</p>
  
  <p>Is there a way to configure nginx so that my 404.html always gets my css and js from / ?</p>
  
  <p>Thanks for your help !</p>