title: nginx proxy_pass to a directory
body: <p>How can I setup nginx to reverse proxy a single folder to one server and the rest of root to a different server?</p>
  
  <p>The root "/" is managed by CMS while the "other" is my own programs (independent of the CMS).</p>
  
  <p>Here is my current configuration</p>
  
  <pre><code>server {
      listen  80;
      server_name www.example.com;
      rewrite     ^   https://$server_name$request_uri? permanent;
  }
  
  server {
      listen   443;
      ... &lt;ssl stuff&gt; ...
  
      server_name www.example.com;
  
      location /other {
          proxy_pass http://192.168.2.2/other ;
      }
  
      location / {
          proxy_pass http://192.168.1.1;
      }
  }
  </code></pre>