Nextcloud listening on all ports across network?

I have an snap installation of Nextcloud on Debian 10 and am encountering a strange issue. I can stand up other webservers on my local network and can resolve their addresses just fine; however externally when I try to access them Iā€™m redirected to the nextcloud ā€˜untrusted domainā€™ page, despite being on completely different subdomains and machines.

Iā€™m not trying to access the Nextcloud instance via a trusted domain, simply other subdomains on my network. Ican access Nextcloud fine on that subdomain. The problem is that this ā€œuntrusted domainā€ page appears on the every single subdomain. Nextcloud just takes all traffic pointed at this box or others and returns this ā€œuntrusted domainā€ page.

Sounds like you have port forwarding setup to send all traffic to the snap, and all domains resolve to the same IP. You need to either use different ports (forwarding to different places), or use a reverse proxy in front of everything to send traffic where itā€™s supposed to go.

Sounds like you have port forwarding setup to send all traffic to the snap,

I have port forwarding on my router set up to send traffic on port 80 and 443 to the NC box. How would I verify all traffic is being sent to the snap?

Are the other webserves on the same host?

If yes you have not correct configure your virtual hosts on this host (apache2).
If no you must you a reverse proxy or different ports because your router can only forward name:port to one ip:port .

no, and since itā€™s the snap install Iā€™m not even sure how to cofigure the vhosts.

The other box I will try a reverse proxy with different ports and see how it goes. FWIW itā€™s Iā€™m not trying to forward the same name across the same port. Basically itā€™s something like.
Internal.
nextcloud.domain.tld (port 443) resolves
www.domaint.tld (port 80) resolves

External;
nextcloud.domain.tld (port 443) resolvses
www.domain.tld (port 80) hits nextcloud server and get untrusted domain error.

I do not like Snap. I thought Snap is a ubuntu tool :wink:

Perhaps you like to test this installation.
It works for me fine. Perhaps than i can help you better.
I uses it on many Debian 10 system in the internet and at home with DynDNS, Lets Encrypt, ā€¦

1 Like

Iā€™m starting to not like snap either :wink: but Iā€™ve had this problem using the ā€œvanillaā€ NC installation.

1 Like

You also can use docker

https://hub.docker.com/_/nextcloud/

or images like NextcloudPi

https://ownyourbits.com/nextcloudpi/
->
https://ownyourbits.com/nextcloudpi/#supported_systems

If you reinstall use my link for debian-10-installation.
Post errors.

By all means, feel free to explore other installation methods, but I want to be clear here: this has nothing to do with the installation method. Itā€™s an incorrect network setup. The same problems will be encountered regardless of how nextcloud is installed. If you have different hosts you need to port forward to a host dedicated to reverse proxying by domain name. One to Nextcloud (regardless of installation method), and the others toā€¦ whatever else you have.

Fwiw itā€™s resolved this by changing the network wide domain name to one that doesnā€™t match the NC instance domain name.