How To Install Nextcloud behind a secure reverse proxy (ARM)

Discussion about Docker
User avatar
TMS
TerraMaster Team
Posts: 508
Joined: 20 Oct 2020, 17:06

Re: How To Install Nextcloud behind a secure reverse proxy (ARM)

Post by TMS »

OK,I have modified it.
To contact our tech team, please email to support(at)terra-master.com, remember to replace (at) with @
User avatar
nygage
Posts: 9
Joined: 27 Jan 2021, 19:44

Re: How To Install Nextcloud behind a secure reverse proxy (ARM)

Post by nygage »

I cant connect to the ports of the NAS, I've modified the ports as you said some post ago i've 2080, 2443 and 81 and when i try to connect to 81 using the lan ip of the NAS it says connection refused, any idea of what can be happening?

Thanks
User avatar
StephenM
Posts: 69
Joined: 11 Jan 2021, 21:55

Re: How To Install Nextcloud behind a secure reverse proxy (ARM)

Post by StephenM »

Can I confirm that you are trying to connect to the reverse proxy admin page?

When you executed

Code: Select all

docker-compose up -d
what results did you get?

Have you logged into the main TOS operating system and checked that everything is running and is healthy in the Docker app?

You should have 4 docker containers running and one marked as healthy - nextcloud-proxy-1

The others that should be running are:
nextcloud-app-1
nextcloud-db-1
nextcloud-db1-1

Check the Docker App overview tab.

Are you also running a firewall on the TNAS? If so you will need to modify and port rules to allow the relevant ports to be activated.
User avatar
nygage
Posts: 9
Joined: 27 Jan 2021, 19:44

Re: How To Install Nextcloud behind a secure reverse proxy (ARM)

Post by nygage »

All is working fine but I think Docker has a problem (or at least our version), because the problem come after the reboot, you can check here my post
Thanks!
https://forums.docker.com/t/docker-netw ... oot/103812
User avatar
zpsal
Posts: 5
Joined: 06 Feb 2021, 07:20

Re: How To Install Nextcloud behind a secure reverse proxy (ARM)

Post by zpsal »

I'm having a similiar issue. I can connect to the ports but they just time out.

[root@TNAS config]# telnet localhost 8080
GET /
Connection closed by foreign host

[root@TNAS config]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
129e14ef9512 nextcloud "/entrypoint.sh ap..." 15 minutes ago Up 11 minutes 0.0.0.0:8080->80/tcp nextcloud_app_1
394d065f9ada jc21/nginx-proxy-manager:latest "/init" 16 minutes ago Up 11 minutes (healthy) 0.0.0.0:81->81/tcp, 0.0.0.0:2080->80/tcp, 0.0.0.0:2443->443/tcp nextcloud_proxy_1
74464c3b64f0 mariadb "docker-entrypoint..." 16 minutes ago Up 11 minutes 3306/tcp nextcloud_db_1
134ed0a314d5 mariadb "docker-entrypoint..." 16 minutes ago Up 11 minutes 3306/tcp nextcloud_db1_1

There weren't any errors with docker-compose.


StephenM wrote: 31 Jan 2021, 22:14 Can I confirm that you are trying to connect to the reverse proxy admin page?

When you executed

Code: Select all

docker-compose up -d
what results did you get?

Have you logged into the main TOS operating system and checked that everything is running and is healthy in the Docker app?

You should have 4 docker containers running and one marked as healthy - nextcloud-proxy-1

The others that should be running are:
nextcloud-app-1
nextcloud-db-1
nextcloud-db1-1

Check the Docker App overview tab.

Are you also running a firewall on the TNAS? If so you will need to modify and port rules to allow the relevant ports to be activated.
User avatar
Terra_User123
Posts: 6
Joined: 26 Sep 2020, 04:33

Re: How To Install Nextcloud behind a secure reverse proxy (ARM)

Post by Terra_User123 »

Hi StephenM

Thank you so much for your contribution! I tried your recipe and somehow I had trouble with the NGINX getting it work. After thinking about it deep enough, I got it working. I somehow saw on the other post that you also have/had trouble getting nextcloud to work with NGINX. If you are still having trouble getting this to work, I can glady share you my recipe. In your case, it would be easier then, then our config looks a lot similar.

Cheers!
User avatar
madao
Posts: 3
Joined: 24 Feb 2021, 15:41

Re: How To Install Nextcloud behind a secure reverse proxy (ARM)

Post by madao »

But are you able to connect with
from a device in LAN?

From outside of my LAN all ok...
But from inside that domani points to a 443 port of the NAS instead NGXIN Proxy Manager is listening on port 2443...

Am I doing something wrong?

For the developer, could you please give as in TOS interface the possibility to free up port 80 and port 443 for our needs?

Thanks
User avatar
Terra_User123
Posts: 6
Joined: 26 Sep 2020, 04:33

Re: How To Install Nextcloud behind a secure reverse proxy (ARM)

Post by Terra_User123 »

Hi Madao,

who are you talking to? Maybe its a good idea to reference the person to avoid confusion.

your nextcloud domain needs to be accepted by your router so it can go through. Your nextcloud container must use port 80 but does not need to listen to port 80. i.e you can use whatever port you want like 2080:80. The port 2080 is what you use to access your nextcloud GUI in combined with your local NAS IP address. But if you set up your domain in the Nginx then port 2080 becomes irrelevant when accessing nextcloud. You do not set any nextcloud port on your router! This is done on the Nginx side! on your router you only setup the NC domain and forward the port to your NAS and this port will be pointed to Nginx.

1. configure port forwrding on your router. Forward a port that your domain will use. Say you forward 2045
2. Nginx must listen to 2045 and must use 443. So Nginx docker file is defined 2045:443. You need to define another port in the docker file for the Nginx GUI, this can be 81:81
3. in the Nginx you setup your NC domain and that is setup to http und port 80. In the Nginx you can use a self-signed certificate.
4. check your config.php to make sure that the NC domain is there in the trusted proxy.

As an info, you do not need Port 80 and 443 freed up on NAS as you do not need this for NC.

I hope this can be on help
User avatar
madao
Posts: 3
Joined: 24 Feb 2021, 15:41

Re: How To Install Nextcloud behind a secure reverse proxy (ARM)

Post by madao »

Sorry for the delay @Terra_User123...
I finally solve the problem.
It was fault of the router of my service provider, that it wasn't able to handle LAN such kind of LAN request...
I've changed it with a new one and now it works.
Thanks
User avatar
Armitage
Posts: 3
Joined: 21 Mar 2021, 00:18

Re: How To Install Nextcloud behind a secure reverse proxy (ARM)

Post by Armitage »

Hi,

Thank you for this guide.
Could you offer some guidance?
I've followed it up to executing: docker-compose up -d
When I do this I get Error:
yaml.scanner.ScannerError: while scanning a simple key in "./docker-compose.yml", line 22, column 5 could not find expected ':' in "./docker-compose.yml", line 24, column 5"
What am I doing wrong?

Many Thanks

Armitage
Locked