Accessing NextCloud from WAN

Hello. This is my first post. First of all, thank you very much guys for this great OS!

I’m trying to access the nextcloud in my RPi, but I can’t.

I have installed nextcloud, generated the certificate, set the DDNS, and forwarded port 80 and 443.

Always seems working OK from my LAN. If I go to https://myddns/nextcloud, I get the login dialog.

When I go to http://myddns from WAN, I get a secure connection to the default page. BUT, if I try https://myddns/nextcloud I get "You can’t access this website, ERR_CONNECTION_TIMED_OUT.

First guess was my “allowed domains” in config.php, but no. Here is my config.php

$CONFIG = array (
  'passwordsalt' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  'secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => '*',
  'datadirectory' => '/mnt/dietpi_userdata/nextcloud_data',
  'dbtype' => 'mysql',
  'version' => '',
  'hashingThreads' => 4,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/run/redis/redis-server.sock',
    'port' => 0,
  'overwrite.cli.url' => 'http://localhost/nextcloud',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'oc_admin',
  'dbpassword' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  'installed' => true,
  'instanceid' => 'xxxxxxxxxxxxxxxxxxxxxxx',
  'maintenance' => false,

Could you help me?


I created a guide in the past. Maybe you can have a look

Hi! Thank you. This is the guide I followed to set up my installation.

As I’ve said, it is working from inside, but not from outside. Any guess?

if your https://myddns/nextcloud is working inside the network, it doesn’t seems to be an issue of Nextcloud server because it responding and accessible. Looks more something on the router and how stuf is forwarded to your device. Do you use anything inside your network like firewall that could influence the connection?

If the issue would be with allowed domains, you would be notified by Nextcloud. However it seems your not able to reach the server on port 443 at all from external


As always, you were right :wink:

My ISP is blocking port 443, and because my webserver is redirecting port 80 to port 443, I could’nt access from outside.

So changing redirection in my router (8443->443) and using https://myddns:8443/nextcloud, fixed the issue.

Thank you very much