Hi Danb35,
My current Nextcloud instance in still running on the old jail and I am trying to migrate to the new iocage environment.
I have been experimenting with your script, but I am facing a few annoying issues that are currently preventing me from making the transition.
My current Nextcloud instance is accessed externally by exposing it to the internet via port forwarding with pfsense.
The setup was done following the original post from Joshua:
https://forums.freenas.org/index.php?threads/how-to-owncloud-using-nginx-php-fpm-and-mysql.17786/
https://forums.freenas.org/index.php?threads/how-to-owncloud-using-nginx-php-fpm-and-mysql.17786/
When I first created my setup, Nextcloud was not yet around. Because of it, I retained the original URL address in the following format:
https://domain.net/owncloud
My relatives and friends who have an account or were given links to Owncloud, now and then, still need to access them after I am able to migrate everything.
For now, when installed from the script, the only way I can access Nextcloud is by entering the following address:
https://domain.net
using the original address might still work, but only for Web based browsers. Android application and Windows Desktop app, as far as I can tell, do not have this flexibility and will cause the app from not being able to access the server any longer.
As far as I can tell, I have to look at the RedirectRule from Apache to handle such condition, but it seems as soon as redirection takes place, I am no longer able to access the server. I don't know if it is SSL certificate issue or not.
I have been trying to setup the new environment to work with HTTP only, even then I am not able to get conclusive results. If I did, then I would be able to play around the RedirectRules. Maybe RedirectRule is not the proper way to go. I am still learning.
Let's assume this above issue gets resolved, then the next one is also a major show stopper.
I want to move away from the port forwarding with pfsense, instead, I want to work with Haproxy.
My requirements are to have Haproxy act as a pass-through to one or more instances of Nextcloud.
I have been somewhat successful at pointing to two instance of Nextcloud (brand new install via your scripts) but I have the following limitations:
- If I perform a fresh install of Nextcloud with your script, and have already my frontend and backend setup for it (HTTP using tcp/http offloading) and (HTTPS using ssl/https (TCP mode)) then Letsencript fails validation and Nextcloud can never be accessed.
To fix it, I must disable Haproxy and go back to standard port forwarding and run Letsencrypt validation again. At that point I am able to get the certificate. Only then can I revert back to Haproxy setup.
The real reason Letsencrypt fails is unclear. It would seem Letsencrypt is expeting answer on port 443 after communition was established over port 80. Could be an issue with my Haproxy frontend ACL's not properly set ( I am still learning how Haproxy ACL work with pfsense).
The goal of this experiment is to be able to install one or more instances of Nextcloud behind a pfsense firewall running Haproxy as SSL pass-through to point to multiple backends while retaining the original address being:
https://domain.net/owncloud
This experiment is currently being performed on separate hardware as not to interfere with my production instance of Nextcloud.
Any feedback, recommendation or adjustment to the script (mostly to enable the use implementation of Rewrite or RedirectRule) would be greatly appreciated.
I don't mind going through the learning curve, but I am making very little progress and I might actually face some Haproxy limitation as well.