title: Nginx - reverse proxy and sub directory
body: <p>I would like to make a reverse proxy, which serves a HTTP request, forwards it to one of servers, and then provides a response from that server to client. </p>
  
  <p>For example, client makes the following request: nginxproxy/server1 The result from server is shown to the client. If client clicks on any link (they are relative), the request will be made to: nginxproxy/anylink, but, I would need this link to be nginxproxy/server1/anylink</p>
  
  <p>Is it possible to achieve this with Nginx? Current configuration is very simple, and looks like this:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>  location /server1/ {
      proxy_pass http://server1/;
      proxy_set_header  Host $host;
    }</code></pre>
  </div>
  </div>
  </p>