danb35 / freenas-iocage-nextcloud

Script to create an iocage jail on FreeNAS for the latest Nextcloud 28 release, including Caddy, MariaDB or PostgreSQL, and Let's Encrypt
GNU General Public License v3.0
250 stars 71 forks source link

Can't connect to Nextcloud on LAN #181

Closed ricochebonjour closed 2 years ago

ricochebonjour commented 2 years ago

Hello and thank you @danb35 for this script :smile:

I managed to install Nextcloud on my TrueNAS and configure it with my OVH domain name. Just after the installation I logged in as admin, created users, etc.

But this morning, I can't connect to Nextcloud with my domain : cloud.ricoche.fr I encounter an error of this type: ERR_CONNECTION_RESET I am thinking of a configuration error or a failed step between my router (Livebox Play) and OVH Zone DNS.

I can't connect with the jail IP too.

How to find the source of the problem ? Thank's

ricochebonjour commented 2 years ago

Caddy logfile : https://pastebin.com/25Kbaz27 Replaced my email with xxxx

"No valid IP addresses found for cloud.mydomain.fr" [cloud.mydomain.fr] Obtain: [cloud.mydomain.fr] solving challenges: cloud.mydomain.fr: no solvers available for remaining challenges

I don't know why it worked first, but not anymore...

danb35 commented 2 years ago

"No valid IP addresses found for cloud.ricoche.fr"

That pretty well is your problem--you need to set up a DNS record for cloud.richoche.fr pointing to your public IP address.

ricochebonjour commented 2 years ago

Mmh ok, I created a no-ip account with this address: ricoche.zapto.org This address has for IP / Target the IPv4 WAN address of my router : 86.198.163.189

Im my router, configured DynDns with no-ip : Added ricoche.zapto.org, username and password.

In OVH I changed cloud.ricoche.fr to the domain (CNAME) ricoche.zapto.org Is it correct ?

danb35 commented 2 years ago

Is it correct ?

Seems like it. Your hostname resolves to an IP address now, and I'm able to reach the login page of your Nextcloud installation there.

ricochebonjour commented 2 years ago

Yes thank you ! In fact I can't access to Nextcloud on my local network LAN. However the domain and the IP address are well configured :

'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => 'cloud.mydomain.fr',
    2 => '192.168.1.100',
  ),
ricochebonjour commented 2 years ago

Problem solved using a VPN when I'm on LAN, not ideal but it works well.

danb35 commented 2 years ago

I guess that's one way to do it. But what you really need to do is what I say in the README: configure your LAN (specifically, your router or whatever provides DNS to your LAN) in such a way that cloud.mydomain.fr resolves to 192.168.1.100 from within your LAN.

ricochebonjour commented 2 years ago

Impossible because my router does not support hairpinning... I ordered a new one which will solve this problem, I hope.

danb35 commented 2 years ago

This has nothing to do with hairpinning (although that would me another may to make this work); it's all a matter of DNS. If your router doesn't support split DNS, a local Pi-Hole instance (which runs fine in a VM on Free/TrueNAS) would do the job.