title: Path Issue while configuring nginx
body: <p>I have a node application running on ports 1111.I have configured server block as</p>
  
  <pre><code>server {
              listen 80;
              location / {
                      proxy_pass http://127.0.0.1:8080;
              }
              location /app {
              rewrite ^/app(.*) /$1 break;
                      proxy_pass http://127.0.0.1:1111;
              }
      }
  </code></pre>
  
  <p>index.html file for app is </p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Node app&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h1&gt;App&lt;/h1&gt;
      &lt;div id="nodeApp"&gt;&lt;/div&gt;
      &lt;script src="script.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>And script.js is</p>
  
  <pre><code>var heading = document.getElementById('nodeApp');
  heading.innerHTML = "This is node App  contents";
  </code></pre>
  
  <p>The issue is when I run <a href="http://127.0.0.1:1111" rel="nofollow noreferrer">http://127.0.0.1:1111</a> it works perfectly fine.But what I intend to do is <a href="http://127.0.0.1/app" rel="nofollow noreferrer">http://127.0.0.1/app</a> and it gets redirected to <a href="http://127.0.0.1:1111" rel="nofollow noreferrer">http://127.0.0.1:1111</a> but it can not get script.js.I have also tried <a href="https://stackoverflow.com/questions/24292479/replace-image-and-javascript-absolute-paths-through-proxy-redirect-in-nginx">Replace image and javascript absolute paths through proxy_redirect in nginx</a>.
  But it did not work.</p>