Skip to content

Commit

Permalink
Merge pull request #564 from nextcloud/enh/543/traefik
Browse files Browse the repository at this point in the history
add Treafik 2 to reverse proxy documentation
  • Loading branch information
szaimen committed May 5, 2022
2 parents 0a1e2c4 + 2c4ba5f commit ae36756
Showing 1 changed file with 34 additions and 3 deletions.
37 changes: 34 additions & 3 deletions reverse-proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

**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

Expand All @@ -13,7 +13,7 @@ All examples below will use port `11000` as example apache port. Also it is supp
<details>

<summary>click here to expand</summary>
<br>

Add this to your Caddyfile:

```
Expand All @@ -32,7 +32,6 @@ Of course you need to modify `<your-nc-domain>` to the domain on which you want
<details>

<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!

Expand All @@ -56,6 +55,38 @@ Of course SSL needs to be set up as well e.g. by using certbot and your domain m

</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

After adjusting your reverse proxy config, use the following command to start AIO:
Expand Down

0 comments on commit ae36756

Please sign in to comment.