Redirect to localhost, trusted domain in place

Hi there forum,

Allthough I've got a trusted domain setting my (new) owncloud server redirects to localhost.

Old server: Ubuntu 14.04, Apache 2.4, php5.6
New server: Ubuntu 16.04, Apache 2.4, php7.0

Owncloud the same on both servers

I've been running owncloud on a leftover pc I had laying around. Together with some WordPress sites I host for myself. The hardware got outdated so I decided to move to new hardware.... starting with owncloud.

I kept the original server in place and changed the vhost file with a proxy pass to the new hardware:
root@precious:/etc/apache2# cat sites-enabled/owncloud.conf

ServerAdmin *********
ProxyPass /
ProxyPassReverse /


Because the host is resolved as a public IP I'v placed an entry in /etc/host like so

root@precious:/etc/apache2# grep oc.bilbos /etc/hosts

With this in place the old server ( should now be redirecting traffic to the new server (

On the new server I'v got the following vhost file:

root@precious-2017:/var/www/owncloud/config# cat /etc/apache2/sites-enabled/owncloud.conf
<Virtualhost *:80>
   ServerAdmin *******
   DocumentRoot /var/www/owncloud
  <Directory "/var/www/owncloud">
    Options +FollowSymLinks
    AllowOverride All

    <IfModule mod_dav.c>
        Dav off

    SetEnv HOME /var/www/owncloud
    SetEnv HTTP_HOME /var/www/owncloud

  <Directory "/var/www/owncloud/data/">
    # just in case if .htaccess gets disabled
    Require all denied

   ErrorLog /var/log/apache2/owncloud/error_log
   CustomLog /var/log/apache2/owncloud/access_log common

The owncloud config has the trusted domain array set

  array (
    0 => '',

I've even made an entry in /etc/hosts for but that didn;t help.... I stll get redirected to localhost.

The apache log of a request is: - - [28/Jul/2017:22:54:39 +0200] "GET / HTTP/1.1" 302 1320

http code 302 being a redirect (to localhost?)

I'm at a loss at the moment... I anyone could help? please :smiley:


oC 9.0.0 is quite outdated:

Personally i wouldn't look for any issues in such a way too old version.

From what i can remember there are also some notes about proxies and stuff documented somewhere at

Seems you're right... an upgrade to 9,1 fixed the problem