Setup a Play hosting through in a subdirectory in Apache SSL virtualhost

If you need to host a MyDMAM website through an existing SSL hosting, by example for provide access to MyDMAM via a secured extranet, without buy/create another SSL certificate.

We’ll used Apache proxy modules, and change Play configuration base.

Setup Apache

Activate modules

# a2enmod proxy
# a2enmod proxy_http
# service apache2 restart

Update your actual enabled virtualhost configuration.

<Location /mydmamsubdir>
    ProxyPass http://mydmamplayerserver:9001/mydmamsubdir
    ProxyPassReverse http://mydmamplayerserver:9001/mydmamsubdir
    RequestHeader set X_FORWARDED_PROTO 'https'
    ProxyPreserveHost on

The mydmamsubdir value will be exposed like https://webservervirtualhosted.domain/mydmamsubdir

Test new configuration with

# apachectl configtest

And reload Apache configuration :

# service apache2 reload

Setup Play

But now, you need to tell to Play to create URLs with /mydmamsubdir.

In mydmam setup directory, like /opt/mydmam, edit the conf/application.conf file, and update like :


Restart MyDMAM/Play server.