On my public-facing host, Apache works as reverse proxy to a non-public host, where a Drupal 9 instance is symlinked under the web root. Drupal answers to requests, but it outputs any local links with the symlink name included. Apparently because the PHP request variable $_SERVER['SCRIPT_NAME']
includes it.
How do I tell Drupal about it's "actual" base path?
The details
Public host config:
<Location "/">
ProxyPreserveHost on
ProxyPassReverse "https://otherserver/webb/"
</Location>
On otherserver
, my domain example.com
is a virtual host with its root in /var/www/sites/example.com/html
. There is this symlink webb
, pointing to the Drupal location:
/var/www/sites/example.com/html/webb -> /var/www/sites/example.com/html/drupal8/web/
Drupal responds, but in the response HTML, a link that should be to /about
is instead to /webb/about
, and the same goes for assets, etc.
If I echo $_SERVER['SCRIPT_NAME']
, I get /webb/index.php
.