Can't access Nextcloud via internet

Hi folks,
first things first: Iā€™m a newbie in using Nextcloud and Iā€™m also not an administrator or even an experienced Linux or RasPi user.
I decided to dust my BananaPi and install some useful stuff on it when a colleague of mine told me about Nextcloud. I was totally thrilled just by thinking of having my own cloud system so I spent almost a whole weekend trying to install the software using different configurations (nginx, apache2, ARMbian legacy, ARMbian mainline, MariaDB, MySQL and so on) almost freaking out at the end of Sunday.
Long story short, a pretty nice guide by a blogger called FlyingHazard (http://www.instructables.com/id/NextCloud-on-the-Raspberry-Pi-DIY-Dropbox/) finally brought me to having it run today (btw the Installation Guide given by Nextcloud itself really is a bit unclear and incomprehensible if youā€™re not familiar with apache/nginx web server usage).

Hereā€™s my problem: Iā€™m able to use Nextcloud via my local IP adress (192.168.0.xx/nextcloud) but not via my external, registered domain.
My domain configuration is as follows:
Iā€™m using the Dataplicity DynDNS service which gives me a host accessible via internet (looks sth. like https://blabla-bla-1234.dataplicity.io) over which I can connect to my Nextcloud without any problem (with the /nextcloud suffix of course) so I decided to redirect one of my domains registered at 1&1 (the German one) which is called xyz.net to that URL. Now trying to access the Nextcloud via xyz.net/nextcloud Chrome throws an error ā€œblabla-bla-1234.dataplicity.io redirected you too many times.ā€ (it doesnā€™t matter if Iā€™m connecting via http or https, I just get the exact same result).

Hereā€™s my xyz.net.conf:

<VirtualHost *:80>
ServerName xyz.net
ServerAdmin admin@website.de
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log

What am I missing? Is there something I have yet to configure?

Thanks a lot in advance!

Hi taiBsu,

the re-directed domain didnā€™t match your ServerName.
Better would be using one of your sub domains as dyndns service, if that is possible with your 1&1 hosting package.
I use a Strato hosting package (PowerWeb or so) and declare one sub domain as dyndns, giving e.g cloud.xyz.net and then let my router use cloud.xyz.net as dyndns service.

Cheers,
Ralf

Hi Ralf,
unfortunately 1&1 doesnā€™t support a DynDNS service hence Iā€™m forced to redirect my desired domain to the Dataplicity domain. I think I get your point but what do I have to change in my Apache configuration now?

Thereā€™s nothing explicitly ā€˜wrongā€™ with the apache conf, if youā€™re doing a straight forward to the other domain and itā€™s throwing a Chrome error then potentially an issue with how itā€™s forwarded?

@JasonBayton Iā€™m doing Frame Forwarding, maybe thatā€™s a possible source of failure?

Yup. Iā€™d say so. Push a CNAME DNS record in instead pointing www.yourdomain.com to the dataplicity domain.

There we go, changing it to HTTP redirect solved the problem. However, now my browser shows a bad-styled URL when Iā€™m accessing the domain. Is there a way to change that?

I have no idea what that means. :smiley:

Open your domain settings with your registrar, look up the DNS options, then add a record - not A, MX, or otherwise, but CNAME - that directs www.yourdomain.com to your.dataplicity.io.

Youā€™ll need to add it as a verified domain for NC when you first use it, but itā€™ll otherwise solve the problem.

Iā€™m not really sure what this is supposed to mean. What does the prefix do and do I really have to enter the target URL in the ā€œWertā€ (value) field?
asdf

By the way I found out that changing the redirect method didnā€™t solve the problem completely. Typing xyz.net in the Nextcloud Desktop client opens up a popup throwing an HTTP error 502 (moved permanently).

Prefix:

www or cloud

Wert:

xxx.dataplicity.io

No https, no /nextcloud

Then you can enter www.domain.net/nextcloud and itā€™ll work

Well this is starting to drive me nuts. For any reason I have to put that underscore before the prefix or else Iā€™m not able to even create that CNAME entry. ā€œwwwā€ or ā€œcloudā€ wonā€™t work for that.
Anyways, having that CNAME entry created (_cloud.xyz.net), Iā€™m neither able to access my site via cloud.xyz.net nor (obviously) _cloud.xyz.net nor will the domain name change after typing xyz.net.

asdf

Do I still need to have the redirect activated or for what do I have to change the domain type to now? Iā€™m completely irritated by that stuff, sorry.

EDIT: OK, googling around a bit and trying some stuff at another one of my domains (_cloud.domainKey as prefix for abc.de) I found out that itā€™s possible to make something like a redirection for a subdomain without having to add a subdomain with a redirect rule. Still Iā€™m wondering whatā€™s the difference between simply adding a subdomain to my domain (which I actually didnā€™t even want btw) and adding a CNAME record for a domain.

Belonging my main question: I managed to redirect my domain to the Dataplicity via HTTP redirect to blabla.dataplicity.io which caused the domain to work in browsers, however displaying the targetā€™s domain URL which is pretty ugly.
Still there are two problems:

  1. I donā€™t want the ugly URL but my main domain (without any subdomain) to appear in the address bar replacing the dataplicity fully-qualified domain name. Isnā€™t there a possibility via htaccess, apache2.conf, domain.com.conf or similar or is the only way to do this by adding a CNAME entry for a subdomain? If so, why does the target URL still appear in the address bar even after adding that CNAME entry for the subdomain?

  2. Neither the Nextcloud Desktop nor the Android client will accept one of the domains Iā€™m trying to configure as ā€œmain domainsā€ (xyz.net / cloud.abc.de). Do I always have to enter the fully-qualified domain name given by Dataplicity to configure those clients? I want my family to take part in that Nextcloud project but I also want to make it easy for them to connect e.g. by just having to type abc.de at the very first client startup.

Sorry for all those questions, Cheers and good night.

When you create a CNAME it can take up to 24hours to apply.

CNAME is the easiest as an A record (pointing to IP) will change periodically, and a redirect will show the old domain. But you canā€™t CNAME the naked domainā€¦ so a redirect from naked to www. or cloud. would get around that.

I canā€™t tell you why you need to put an underscore there, but your registrar can.

No, youā€™re manipulating a domain, so you need to do so via DNS. An apache conf does literally nothing without DNS in place.

No, just get it correctly submitted (via registrar help if required) and wait up to 24hr. Then you can use your new domain.

Thanks a lot for your effort, Jason. I just configured a new subdomain on my main domain abc.de and will wait as long as it takes (for the moment thereā€™s just a blank page) till Iā€™ll hopefully see some results. Iā€™ll let you know if it worked.

For anyone facing similar one-ways in their domain configuration centres:
configuring the subdomain from scratch and setting the CNAME without adding an extra CNAME entry to an already existing subdomain worked out fine and I didnā€™t have to type the underscore or even a prefix at all for that. I just changed the domain type of use (ā€œVerwendungsartā€) from ā€œRedirectā€ to ā€œDNS configurationā€ and changed from ā€œ1&1 IP-Adresseā€ to ā€œCNAMEā€ followed by typing the fully-qualified domain name, thatā€™s it. Iā€™m now looking forward to having the DNS updated and seeing whatā€™s happening.

Thanks again! Cheers