Proxying a subdirectory to a remote site The goal

Make all requests to a previously static page at https://www.example.com/sub/folder on server 1 (Proxy) ACTUALLY go to a Drupal site at https://other.example.com on server 2 (Origin)

This is also getting setup as a multisite, because there are sub/folder2, sub/folder3, etc. that will need to be converted to Drupal sites. I don't think this has anything to do with the problem, but for the sake of completeness, I'm adding the sites.php changes too below.

What I've done so far

Changes on Server 1 (Proxy): Apache config

RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} ^/sub/folder
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
SSLProxyEngine On
&lt;Location /sub/folder&gt;
  ProxyPass https://other.example.com/
  ProxyPassReverse https://other.example.com/
  ProxyPassReverseCookiePath / /sub/folder
&lt;/Location&gt;


Changes on Server 2 (Origin): settings.php and sites.php

sites.php (because of multisite; and sites/sitename/settings.php is the file I'll be referencing below)

$sites['other.example.com'] = 'sitename';
$sites['www.example.com.sub.folder'] = 'sitename'; // I don't think this one is necessary, but just in case?


Aside from the standard DB setup in settings.php, the following has been added:

// $base_url allows for links/URIs to be generated properly
// Changing the REQUEST_URI seems to have fixed form issues, like the search block/form
// Not sure if the cookie_domain is doing anything/working properly
if (isset($_SERVER['HTTP_X_FORWARDED_HOST']) &amp;&amp; $_SERVER['HTTP_X_FORWARDED_HOST'] == 'www.example.com') {
  $base_url = 'https://www.example.com/sub/folder'; // NO trailing slash!
  $_SERVER['REQUEST_URI'] = '/sub/folder' . $_SERVER['REQUEST_URI'];
  // (Edit) note don't put 'http' in front of this
  $cookie_domain = '.other.example.com';
}
...
$conf['reverse_proxy'] = TRUE;
...
$conf['reverse_proxy_addresses'] = array('ip.of.origin.server');


The problems


Trying to login through www.example.com/sub/folder/user validates (according to Drupal log)... but then it treats the page re-load as an anonymous user and fails access. Presumably, the cookie gets broke/lost/invalidated somehow in between. So, authenticated access to the server has to be done through other.example.com Not a huge problem (since the average Joe won't be logging in), but...
There's just a lot of annoying things occuring having to deal with fixing user/content created links and URIs. Currently, links that are first viewed after a cache clear are cached as whatever domain they're being viewed from. (This happened from using Pathologic module to force absolute URLs.) I realize this might not have been the BEST solution--using Pathologic--but if I fix problem 1., this should become a moot point.


So, I think I've got some kind of SSL/Proxy cookie issue at this point... any suggestions?
Drupal should be able to install into a sub-directory and "just work" without fiddling around with it. This question already answers this particular sub-directory issue:

How to get Drupal 7 installed in a sub-folder / sub-directory properly?

Try re-installing a fresh installation into the sub-directory. Can you login? The .htaccess of 2.site.com should have nothing to do with the issue at hand regarding 1.site.com.

The reason for your problem is likely something along the lines of a clean-url issue fighting against your configurations. A fresh install will be the easiest way to resolve this particular issue.

Regarding this line:


  and I'd like only that subdirectory to go to an arbitrarily named
  server with a drupal install at, say "https://2.site.com"


The domain merely points to a directory. The domain ISN'T an actual file location. As such, this particular line doesn't seem to make any sense. If the issue is not resolved by simply clearing out and reinstalling Drupal in the sub-directory at hand, please re-state your question by providing more information, describe where these sub-directories are in the system root relative to each other and then describe which directory each domain points to. Don't describe domains AS directories because they aren't directories - they're pointers.