Merge pull request #564 from nextcloud/enh/543/traefik

add Treafik 2 to reverse proxy documentation
This commit is contained in:
Simon L 2022-05-05 09:22:04 +02:00 committed by GitHub
commit ae36756476
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,7 +4,7 @@ Basically, you need to specify the port that the apache container shall use and
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. 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.
**Info:** The instructions below assume that your reverse proxy is installed directly on the host, not inside a separate docker container. If you want to run the reverse proxy inside a docker container, you can do so by using the `--network host` option when starting the reverse proxy container. **Info:** The instructions below assume that your reverse proxy is installed directly on the host, not inside a separate docker container. If you want to run the reverse proxy inside a docker container, you can do so by using the `--network host` option when starting the reverse proxy container. Or if you don't want to use the networks host option, substituting `localhost` by the internal ip-address of the Host might work.
### Reverse proxy config examples ### Reverse proxy config examples
@ -13,7 +13,7 @@ All examples below will use port `11000` as example apache port. Also it is supp
<details> <details>
<summary>click here to expand</summary> <summary>click here to expand</summary>
<br>
Add this to your Caddyfile: Add this to your Caddyfile:
``` ```
@ -32,7 +32,6 @@ Of course you need to modify `<your-nc-domain>` to the domain on which you want
<details> <details>
<summary>click here to expand</summary> <summary>click here to expand</summary>
<br>
**Disclaimer:** the config below is not working 100% correctly, yet. See e.g. https://github.com/nextcloud/all-in-one/issues/450, https://github.com/nextcloud/all-in-one/issues/447 and https://github.com/nextcloud/all-in-one/issues/491. Improvements to it are very welcome! **Disclaimer:** the config below is not working 100% correctly, yet. See e.g. https://github.com/nextcloud/all-in-one/issues/450, https://github.com/nextcloud/all-in-one/issues/447 and https://github.com/nextcloud/all-in-one/issues/491. Improvements to it are very welcome!
@ -56,6 +55,38 @@ Of course SSL needs to be set up as well e.g. by using certbot and your domain m
</details> </details>
#### Traefik 2
<details>
<summary>click here to expand</summary>
**Disclaimer:** It might be possible that the config below is not working 100% correctly, yet. Improvements to it are very welcome!
Add a `nc.toml` to the treafik rules folder with the following content:
```toml
[http.routers]
[http.routers.nc-rtr]
entryPoints = ["https"]
rule = "Host(<your-nc-domain>)"
service = "nc-svc"
middlewares = ["chain-no-auth"]
[http.routers.nc-rtr.tls]
certresolver = "le"
[http.services]
[http.services.nc-svc]
[http.services.nc-svc.loadBalancer]
passHostHeader = true
[[http.services.nc-svc.loadBalancer.servers]]
url = "http://localhost:11000"
```
Of course you need to modify `<your-nc-domain>` to the domain on which you want to run Nextcloud.
</details>
### Startup command ### Startup command
After adjusting your reverse proxy config, use the following command to start AIO: After adjusting your reverse proxy config, use the following command to start AIO: