title: NGINX reverse proxy to a host with no root subdirectory
body: <p>Usually, when doing a reverse proxy setup, you have a server on your backend which looks like this:</p>
  
  <p><a href="http://localhost:8084/app-root" rel="nofollow noreferrer">http://localhost:8084/app-root</a></p>
  
  <p>and you can proxy_pass</p>
  
  <p><code>location /app-root {
    proxy_pass http://localhost:8084;
  }
  </code></p>
  
  <p>It will proxy www.my-domain.com/app-root to  the internal server <a href="http://localhost:8084/app-root" rel="nofollow noreferrer">http://localhost:8084/app-root</a>. </p>
  
  <p>Great!</p>
  
  <p>Can someone explain what needs to be done if the server insists on hosting from the root as so:</p>
  
  <p><a href="http://localhost:8084/index.html" rel="nofollow noreferrer">http://localhost:8084/index.html</a>
  <a href="http://localhost:8084/images/image1.jpg" rel="nofollow noreferrer">http://localhost:8084/images/image1.jpg</a></p>
  
  <p>I want this to be accessible via</p>
  
  <p><a href="http://www.my-domain.com/app/index.html" rel="nofollow noreferrer">http://www.my-domain.com/app/index.html</a><br>
  <a href="http://www.my-domain.com/app/images/image1.jpg" rel="nofollow noreferrer">http://www.my-domain.com/app/images/image1.jpg</a></p>