title: Drupal 8 + Nginx reverse proxy as subdir
body: <p>we have a web server with drupal 8 running on nginx + php-fpm. We would like to use a reverse proxy server to publish the d8 website as www.somedomain.com/drupal8</p>
  
  <p>The nginx config works just fine:</p>
  
  <pre><code>location /article_dev/ {
      proxy_buffers 32 32k;
      proxy_buffer_size 32k;
      proxy_pass http://192.168.158.148:80/;
      proxy_set_header    Host $host;
      proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header    X-Forwarded-Proto $scheme;
      proxy_set_header    X-Forwarded-By $server_addr:$server_port;
      proxy_set_header    X-Real-IP $remote_addr;
  }
  </code></pre>
  
  <p>and in the settings.php I have set up the reverse proxy settings. The problem is that when I visit externaldomain.com/article_dev/ I see the d8 page, but no css etc is loaded since the paths to the resources are: externaldomain.com/path_to_ressource and not externaldomain.com/article_dev/path_to_ressource</p>
  
  <p>In earlier versions of Drupal (6 and 7) It was possible to set the global $base_url to do the trick. Since D8 the $base_url has been depreated in the settings.php for reasons explained here <a href="https://www.drupal.org/node/2528988" rel="nofollow">https://www.drupal.org/node/2528988</a></p>
  
  <p>This however is not bringing me any closer to achieving the goal to proxy the second site as a subdir...</p>
  
  <p>Any help would be appreciated!</p>
  
  <p>Regards,
  T</p>