Can access Nextcloud outside network(School, mobile data/ but not in my own WiFi


Nextcloud version: 16.0.3
Operating system and version: Ubuntu 18.04.2
Apache: Apache/2.4.29
PHP version: PHP 7.2.19-0

The issue you are facing:
I can access my nextcloud server through another WiFi (for example: school) but when I’m connected to my home WiFi/Internet and I try to access it, it just takes me to “This site cant be reached” page on Chrome.

Is this the first time you’ve seen this error? (Y/N): Yes

Steps to replicate it:

  1. Tried to login to my account
  2. Don’t remember what it said exactly, but it went something like this: "Warning “This IP has tried to connect too many times. Please try in 30 seconds”
  3. Restart apache2. Problem started

The output of your Nextcloud log in Admin > Logging:

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

$CONFIG = array (
  'instanceid' => '***',
  'passwordsalt' => '***',
  'secret' => '***',
  'trusted_domains' => 
  array (
    0 => 'domain.example,
  'datadirectory' => '/var/www/nextcloud/nextcloud-data',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => 'https://domain.example',
  'dbname' => 'next',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'cloud',
  'dbpassword' => '******',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'maintenance' => false,

The output of your Apache/nginx/system log in /var/log/____:

Which one: access.log or error.log?

I think, this is most likely a DNS problem. The FQDN you are using to access your server over the internet isn’t correctly resolved on your LAN or do you try to access your server using an ip address? If your ip address is blocked you should check if the brute-force settings app is causing problems.

I am not trying to access the server using an IP but with the domain i set up.
I have other websites besides my nextcloud on the same machine using apache2 and i can not access those either.

If you use a FQDN to access the server, this is resolved to the external ip address of your internet router. Very often this ip address cannot be accessed from within your LAN. I think there are two ways to solve this problem:

  1. Setup a local DNS on your LAN and make sure that the assigned FQDN is being resolved to the local address of your Nextcloud server. (That would be my preferred solution, although it is more complex)
  2. Use a different DNS name on your LAN to access your Nextcloud server. (This is relatively simple to apply)
    Keep in mind that you will need a security certificate for both DNS names of your server, to prevent certificate errors.
  3. Use the local IP address of your server. (This is relatively simple to apply)
    Keep in mind that you will need a security certificate for the DNS name and IP address of your server, to prevent certificate errors. Unfortunately such certificates are not supported by e.g. Let’s encrypt etc.

I solved the problem by using this very advanced tactic.
I just restarted my router and now i can access my Nextcloud server and my other website.
Thank you j-ed for trying to help me.

1 Like