Setting up a complex Apache reverse proxy

We are about to move a website to a new server running a new piece of software, normally a simple change but we also have a dutch version of the website running in a folder /nl.

We would like to transfer the domain www.example.com to point towards the new server but any requests made to /nl and within will be diverted to dutch.example.com. Here is what we have so far.

    ProxyRequests Off

    <Proxy *>
            Order deny,allow
            Allow from all
    </Proxy>

    ProxyPass /nl http://dutch.example.com/nl
    ProxyPassReverse /nl http://dutch.example.com/nl

It becomes more complicated because images for the dutch site are mixed with the images for the current UK site, these images will no longer exist on the new site. So we also need any /assets requests to be dealt with by the proxy. On top of all this, its an ecommerce website so it should be possible for all this to happen over SSL.

Is this possible?

Your help is very much appreciated


Assuming you have Apache as frontend and the English site and Dutch site as backend, try something like this:

    NameVirtualHost *:80

    <VirtualHost *:80>
        ServerName multilanguage.example.com
        <Location /nl>
                ProxyPass http://dutch.example.com/nl
                ProxyPassReverse http://dutch.example.com/nl
        </Location>
        ProxyPass / http://eng.example.com/
        ProxyPassReverse / http://eng.example.com/
    </VirtualHost>

This configuration will

  • If multilanguage.example.com is entered it will proxy to eng.example.com
  • With multilanguage.example.com/nl it will proxy to dutch.example.com/nl

You can easily add the SSL configuration by taking a look at ssl.conf file.