Unable to access files with FQDN, but can with IP

When I attempt to access the url:

http://192.168.25.158/index.php/apps/files/?dir=/&fileid=2

I get a list of all my files.

But when I try to get to it via my domain url:

http://cloud.mydomain.com/index.php/apps/files/?dir=/&fileid=2

It sits there. I check chrome console, and I’m getting this error:

client.js?v=f57a764…:245 Uncaught (in promise) TypeError: Cannot read property 'substr' of undefined
    at Client._parseFileInfo (client.js?v=f57a764…:245)
    at client.js?v=f57a764…:367
    at Function._.map._.collect (underscore.js?v=f57a764…:172)
    at Client._parseResult (client.js?v=f57a764…:366)
    at client.js?v=f57a764…:428
    at <anonymous>

Which points to this line:

		/**
		 * Parse Webdav result
		 *
		 * @param {Object} response XML object
		 *
		 * @return {Array.<FileInfo>} array of file info
		 */
		_parseFileInfo: function(response) {
			var path = response.href;
			if (path.substr(0, this._root.length) === this._root) { <--this line right here.

So, I went to the server settings and I’m seeing this:

Your web server is not yet set up properly to allow file synchronization because the WebDAV interface seems to be broken.

But when I run it with the IP address, it works.

Here is my config.php:

<?php
$CONFIG = array (
  'instanceid' => 'my instance id',
  'passwordsalt' => 'a salt goes here',
  'secret' => 'long secret goes here',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => 'redis-cluster.mylocal.domain',
    'port' => '6380',
  ),
  'trusted_domains' =>
  array (
    0 => 'cloud.mydomain.com',
    1 => '192.168.25.158',
  ),
  'datadirectory' => '/mnt/cloud',
  'overwrite.cli.url' => 'http://192.168.25.158',
  'dbtype' => 'mysql',
  'version' => '11.0.3.2',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => 'my_password',
  'logtimezone' => 'UTC',
  'installed' => true,
  'user_backends' =>
  array (
    0 =>
    array (
      'class' => 'OC_User_Zimbra',
      'arguments' =>
      array (
      ),
    ),
  ),
);

Here is the apache config:

Alias / "/var/www/nextcloud/"

<Directory /var/www/nextcloud/>
  Options +FollowSymlinks
  AllowOverride All

 <IfModule mod_dav.c>
  Dav off
 </IfModule>

 SetEnv HOME /var/www/nextcloud
 SetEnv HTTP_HOME /var/www/nextcloud

</Directory>

Here are the apache mods that I had enabled during install:

a2enmod rewrite
a2enmod headers
a2enmod env
a2enmod dir
a2enmod mime
a2enmod setenvif

I have disabled the zimbra drive module as well, and it does not affect anything.

It also does this via http, and https

I’m running version 11.0.3 (I can’t run 12 due to zimbra drive module does not work otherwise I would)

Any thoughts on what is causing this?

You’re overwriting the URL with that of your internal address. I’d say normally better to do the opposite and put in a DNS oveerride on the local network to point back to the NC server.

Worse, if you’re coming over HTTPs this may definitely cause problems as you’re forcing HTTP.

May not be the problem, but I wouldn’t dismiss it first.

Thank you for the response.

I changed it to https://cloud.mydomain.com and even http (for testing), and this did not resolve the issue. I even removed the line from the config.

Thanks

Found the problem. Our firewall appliance was blocking the webdav via the PROPFIND tag.

Thanks for your help on this.

1 Like

At least we proactively solved a config issue in the process, eh? :wink:

1 Like