mercredi 23 mars 2016

Multiple DocumentRoot within same VirtualHost

We have a webserver and have configured different configuration for request incoming at port 80 and 443 via VirtualHost configuration. The objective is multiple but one of it was to set the DocumentRoot folder different:

<VirtualHost *:80>
DocumentRoot "/x/www/var/insecure-htdocs"
</VirtualHost>

<VirtualHost *:443>
DocumentRoot "/x/www/var/secure-htdocs"
</VirtualHost>

Now at our load balance level due to some issues we have configured to redirect all HTTP request to HTTPS (incoming at port 80 redirected to port 443).

This is creating an issue when a HTTP (at port 80) request comes to download a file:

Like

http://ift.tt/1XMswB3

changes to

http://ift.tt/1UFy42h

Since the DocumentRoot for HTTPS(port 443) is different it fails since the file is not present in that folder.

I tried a lot using Alias and ScriptAlias configuration but nothing works - please suggest how to set multiple DocumentRoot for one VirtualHost based upon the above URL pattern




Aucun commentaire:

Enregistrer un commentaire