title: Nginx proxy for node.js app error: Failed to load resource
body: <p>I have two node.js apps: one is my site and second is CI tool. I have the following nginx config:</p>
  
  <pre><code>server {
      listen 80;
  
      server_name example.com;
  
      location / {
          proxy_pass    http://127.0.0.1:8081/;
      }
  
      location /ci {
          rewrite ^/ci(.*) /$1 break;
          proxy_pass http://127.0.0.1:3000/;
      }
  }
  </code></pre>
  
  <p>When i open example.com in browser it loads all resources requested by index.html correctly, but when i open example.com/ci it loads only index.html and i got errors like these:</p>
  
  <pre><code>GET http://example.com/styles/styles.css     404
  GET http://example.com/scripts/app.js        404
  </code></pre>
  
  <p>I have added <code>&lt;base href="/ci"&gt;</code> into head of index.html in my CI app, but it doesn't help.</p>