Skip to content

Commit 853a880

Browse files
authored
Merge pull request #286 from nextcloud/enh/noid/reverse-proxy-docs
add reverse proxy docs
2 parents 0ecd2c8 + 2943c6c commit 853a880

File tree

2 files changed

+74
-6
lines changed

2 files changed

+74
-6
lines changed

readme.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -66,28 +66,28 @@ Included are:
6666
</details>
6767
6868
4. After the initial startup, you should be able to open the Nextcloud AIO Interface now on port 8080 of this server.<br>
69-
E.g. https://internal.ip.of.this.server:8080<br>
69+
E.g. `https://internal.ip.of.this.server:8080`<br>
7070
If your server has port 80 and 8443 open and you point a domain to your server, you can get a valid certificate automatially by opening the Nextcloud AIO Interface via:<br>
71-
https://your-domain-that-points-to-this-server.tld:8443
71+
`https://your-domain-that-points-to-this-server.tld:8443`
72+
5. Please do not forget to open port `3478/TCP` and `3478/UDP` for the Talk container!
7273
7374
## FAQ
7475
### How does it work?
7576
Nextcloud AIO is inspired by projects like Portainer that allow to manage the docker daemon by talking to the docker socket directly. This concept allows to install only one container with a single command that does the heavy lifting of creating and managing all containers that are needed in order to provide a Nextcloud installation with most features included. It also makes updating a breeze and is not bound to the host system (and its slow updates) anymore as everything is in containers. Additionally, it is very easy to handle from a user perspective because a simple interface for managing your Nextcloud AIO installation is provided.
7677
7778
### Are reverse proxies supported?
78-
Reverse proxies are currently because of the above mentioned architecture not supported.<br>
79-
You might investigate yourself though how it could made work behind reverse proxies. If you open a PR with that we might consider it then :)
79+
Yes. Please refer to the following documentation on this: [reverse-proxy.md](https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md)
8080
8181
### Which ports are mandatory to be open?
8282
Only those (if you acces the Mastercontainer Interface internally via port 8080):
83-
- `443/TCP` for the Nextcloud container
83+
- `443/TCP` for the Apache container
8484
- `3478/TCP` and `3478/UDP` for the Talk container
8585
8686
### Explanation of used ports:
8787
- `8080/TCP`: Mastercontainer Interface with self-signed certificate (works always, also if only access via IP-address is possible, e.g. `https://internal.ip.address:8080/`)
8888
- `80/TCP`: redirects to Nextcloud (is used for getting the certificate via ACME http-challenge for the Mastercontainer)
8989
- `8443/TCP`: Mastercontainer Interface with valid certificate (only works if port 80 and 8443 are open and you point a domain to your server. It generates a valid certificate then automatically and access via e.g. `https://public.domain.com:8443/` is possible.)
90-
- `443/TCP`: will be used by the Nextcloud container later on and needs to be open
90+
- `443/TCP`: will be used by the Apache container later on and needs to be open
9191
- `3478/TCP` and `3478/UDP`: will be used by the Turnserver inside the Talk container and needs to be open
9292
9393
### How to run `occ` commands?

reverse-proxy.md

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
## Reverse Proxy Config
2+
3+
Basically, you need to specify the port that the apache container shall use and modify the startup command a bit.
4+
5+
All examples below will use port `11000` as example apache port. Also it is supposed that the reverse proxy runs on the same server like AIO, hence `localhost` is used and not an internal ip-address to point to the AIO instance. Modify both to your needings.
6+
7+
### Caddy reverse proxy config example
8+
9+
Add this to your Caddyfile:
10+
11+
```
12+
https://<your-nc-domain>:443 {
13+
header Strict-Transport-Security max-age=31536000;
14+
reverse_proxy localhost:11000
15+
}
16+
```
17+
18+
Of course you need to modify `<your-nc-domain>` to the domain on which you want to run Nextcloud.
19+
20+
### Startup command
21+
22+
```
23+
# For x64 CPUs:
24+
sudo docker run -it \
25+
--name nextcloud-aio-mastercontainer \
26+
--restart always \
27+
-p 8080:8080 \
28+
-e APACHE_PORT=11000 \
29+
--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
30+
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
31+
nextcloud/all-in-one:latest
32+
```
33+
34+
<details>
35+
36+
<summary>Command for arm64 CPUs like the Raspberry Pi 4</summary>
37+
38+
```
39+
# For arm64 CPUs:
40+
sudo docker run -it \
41+
--name nextcloud-aio-mastercontainer \
42+
--restart always \
43+
-p 8080:8080 \
44+
-e APACHE_PORT=11000 \
45+
--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
46+
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
47+
nextcloud/all-in-one:latest-arm64
48+
```
49+
50+
</details>
51+
52+
After doing so, you should be able to access the AIO Interface via `https://internal.ip.of.this.server:8080`. Enter your domain that you've entered in the reverse proxy config and you should be done. Please do not forget to open port `3478/TCP` and `3478/UDP` for the Talk container!
53+
54+
### Optional
55+
56+
If you want to also access your AIO interface publicly with a valid certificate, you can add e.g. the following config to your Caddyfile:
57+
58+
```
59+
https://<your-nc-domain>:8443 {
60+
reverse_proxy https://localhost:8080 {
61+
transport http {
62+
tls_insecure_skip_verify
63+
}
64+
}
65+
}
66+
```
67+
68+
Of course you also need to modify `<your-nc-domain>` to the domain that you want to use. Afterwards should the AIO interface be accessible via `https://<your-nc-domain>:8443`.

0 commit comments

Comments
 (0)