Error access nextcloud webinterface via http because of automatic forwarding to https

cwi

Cadet
Joined
Mar 23, 2014
Messages
5
After installing nextcloud as a plugin on freenas 11.3 and configuring the "trusted domain" sucessfully I cannot access it via the web interface because I am always automatically forwarded to https. Https always appears in the URL. I can manually open the URL via http, but after entering the user data, it will be redirected to https and get an error. I want to use nextcloud without ssl.

Does somebody has any idea? How can I deactivate the automatic forwarding?
 
Last edited:

dhenzler

Explorer
Joined
Sep 24, 2019
Messages
57
I have experienced the identical issue. Deleted and reinstalled variations five times. Pretty irritating. An earlier ver 20 installed just fine. But then again I made it SSL so I could run it on the web. I may find my notes on ssl install, and do it to this one. I only want to play with some settings and make a backup of my cloud - just in case....
 

dhenzler

Explorer
Joined
Sep 24, 2019
Messages
57
The addition of ssl was the remedy. You need only to add 7 lines of code from that website... I suggest using VI editior to do this so you can copy & paste. I created a self signed certificate using the instructions in the article...works fine. I set mine to expire in 20 years. I'll be dead !

Cheers Dave Henzler
 

anotherme

Cadet
Joined
Oct 19, 2020
Messages
8
While that article does address the 'gap' in terms of SSL (and another aspect), for whatever reason it does not seem to resolve any of the issues on 11.3-U5. Even out of the box, (vanilla FreeNAS install): install Clamav, install Emby, install NextCloud (in that order) and one cannot even log into the NextCloud management interface using non-SSL (it just "spins" on Logging In - failing to even timeout). Tried uninstalling and re-installing numerous times - to no avail. Any thoughts?

Did notice this in the logs (/var/log/nextcloud/nextcloud.log):
OCP\\AppFramework\\QueryException","Message":"Could not resolve OCA\\Files_Versions\\Versions\\IVersionManager! Class can not be instantiated"

Wondering if there is more missing in terms of latest.
 

dhenzler

Explorer
Joined
Sep 24, 2019
Messages
57
Your statement is OUT OF CONTEXT with the problem stated in the initial question. I suggest you move more slowly until you get one app working. If the app fails, you need to remove the app then be sure to delete the iocage created (in my experience) as subsequent installations may reuse parts of the failed iocage.

I'd also suggest you open a NEW topic to get an answer for your question!
 

Tim1962

Patron
Joined
Feb 26, 2015
Messages
281
You might wish to try out my answer in this thread... for nextcloud redirection issue

 

dhenzler

Explorer
Joined
Sep 24, 2019
Messages
57
Thank you for posting this answer. It would be the easy way out for users that didn't want the complexity of SSL. However the side benefit of SSL is doubling the transfer rate over Internet. I tested this 3 years ago while on vacation. Had two servers up, on my IP and the SSL had better transfer rates and didn't drop connection. The downside is 'self signed certificates' require the added step of acceptance on the first connect from any computer.
 

anotherme

Cadet
Joined
Oct 19, 2020
Messages
8
Will certainly create a new thread, however for those who may run into the same issue(s) that include the redirect and being unable to login after using non-SSL access - it makes it far easier to have all the information in one place. Appreciate your response on the iocage aspect, however this is being done as a VM (for testing to validate functionality) and the VM has also been blown away to validate that there wasn't something 'odd' that occurred during any aspect of install. Once a viable, repeatable install is determined - will then do actual install.
 

Moluccan

Dabbler
Joined
Oct 6, 2020
Messages
18
I don't know if this is the problem, but I have created a firewall rule:
  • from any <external_address> with port 8282 forward traffic to <my Internal_address> port 8282
So accessing http://<my_domain_name>:8282 will be forwarded to
 

dhenzler

Explorer
Joined
Sep 24, 2019
Messages
57
Well Moluccan all of the above are band-aid's in my opinion. The problem lies with this version of the NAS Nextcloud app. It didn't used to do this. Aparently someone decided to create it with SSL requirement invoked, and perhaps were only partially removed. But as soon as you add your domain to the list... vollia... it's broken unless you take some action. In your case redirect... (OBTW did that work?) or to move forward on finishing the SSL installation (which does work). Although future distributions may not suffer from this issue
 

Moluccan

Dabbler
Joined
Oct 6, 2020
Messages
18
Well Moluccan all of the above are band-aid's in my opinion. The problem lies with this version of the NAS Nextcloud app. It didn't used to do this. Aparently someone decided to create it with SSL requirement invoked, and perhaps were only partially removed. But as soon as you add your domain to the list... vollia... it's broken unless you take some action. In your case redirect... (OBTW did that work?) or to move forward on finishing the SSL installation (which does work). Although future distributions may not suffer from this issue

I think also this is a band-aid and I am not happy with this, because I want to access my Nextcloud through a https-connection and not http.
In a other topic I have mentioned that I don't know how to setup a https-connection and I am still searching.

But for now as a test:
  • My domain-name is pointing to the WAN-address of my ISP
  • And the domain-name + port is forwarded to my local Nexcloud address
 

dhenzler

Explorer
Joined
Sep 24, 2019
Messages
57
I think also this is a band-aid and I am not happy with this, because I want to access my Nextcloud through a https-connection and not http.
In a other topic I have mentioned that I don't know how to setup a https-connection and I am still searching.

But for now as a test:
  • My domain-name is pointing to the WAN-address of my ISP
  • And the domain-name + port is forwarded to my local Nexcloud address
It's relatively simple... please see => https://fahadusman.com/installing-nextcloud-plugin-on-freenas-11-3-u1/
It works on later versions as well. I used a self signed certificate, as it's only me and a few close friends who access the cloud. Easy enough to accept the security exception and you're in.
I hope this cures your issue... I'm 99% sure it will.
Dave (you'll see this listed above on Oct 17th)
 

Moluccan

Dabbler
Joined
Oct 6, 2020
Messages
18
It's relatively simple... please see => https://fahadusman.com/installing-nextcloud-plugin-on-freenas-11-3-u1/
It works on later versions as well. I used a self signed certificate, as it's only me and a few close friends who access the cloud. Easy enough to accept the security exception and you're in.
I hope this cures your issue... I'm 99% sure it will.
Dave (you'll see this listed above on Oct 17th)

Ok thanks, I will try this and don't hope that I will fall into the 1%
 

dhenzler

Explorer
Joined
Sep 24, 2019
Messages
57
I recommend "cut & paste" from the document to avoid typing errors. Once you have created your SSL files, it's only 7 lines of code that really matter. He goes beyond that with some modifications to the database. However I did not bother with those... I'm a believer if it isn't broke... don't fix it.
 

Moluccan

Dabbler
Joined
Oct 6, 2020
Messages
18
I recommend "cut & paste" from the document to avoid typing errors. Once you have created your SSL files, it's only 7 lines of code that really matter. He goes beyond that with some modifications to the database. However I did not bother with those... I'm a believer if it isn't broke... don't fix it.

I followed all the instructions of "Step 4 – Enable HTTPS".

Trying now to accesss the GUI with https://<my_domain-name>/ but this URL starts the GUI of my Unifi Security Gateway Controller.
The same happens also for the address https://<my_domain-name>:443/

So I have to find out now, which (secure) port I can use to find my NextCloud.

Other question, my TrueNAS and NextCloud are both running under the same ip-address:
But my TrueNAS will be found by using port 443, should I assign NextCloud to a other IP-address?
 
Last edited:

dhenzler

Explorer
Joined
Sep 24, 2019
Messages
57
I followed all the instructions of "Step 4 – Enable HTTPS".

Trying now to accesss the GUI with https://<my_domain-name>/ but this URL starts the GUI of my Unifi Security Gateway Controller.
The same happens also for the address https://<my_domain-name>:443/

So I have to find out now, which (secure) port I can use to find my NextCloud.
Maybe... clear your cache... I have a stubborn cache on my cellphone does that to me all the time.
I'm assuming you added your domain name to the list.. - the https://
don't forget to restart apache2 as well... that'll bite ya
Dave
 

Moluccan

Dabbler
Joined
Oct 6, 2020
Messages
18
Maybe... clear your cache... I have a stubborn cache on my cellphone does that to me all the time.
I'm assuming you added your domain name to the list.. - the https://
don't forget to restart apache2 as well... that'll bite ya
Dave

I am using nginx so I have restarted that and I also restarted the Jail.
But it doesn't work, accessing https://192.168.1.2/ (and 192.168.1.2:443) will lead me to the TrueNAS GUI.
With the old config I had to access http://192.168.1.2:8282/ to start NextCloud.
 

dhenzler

Explorer
Joined
Sep 24, 2019
Messages
57
sorry about the Apache reference... knew it eas Nginx. Anyway be sure your SSL files are in the correct location. my experience is with Free NAS not True BAS. MAY make a difference. Test your SSL to be sure it's working.
 

Moluccan

Dabbler
Joined
Oct 6, 2020
Messages
18
Ok I have reinstalled the NexCloud again, but now with it's own ip-address and I don't know why I had choosen to access the NC through a port.
This solved a lot of issues, so I can access my NC secure and with the FQDN as the address.

Now I have to find out the configuration of the certificates and where I install the certificates.
  • I can choose maybe for my Gateway Server of Unifi
  • I can choose for installing the certificates in the Jail of the NC
I don't know what the best option is and if both will work?
 
Top