Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upDocumentation for Traefik 2.0 Setup #1061
Comments
|
Relevant: nextcloud/server#13612 |
|
Hi @JanoschDeurer It is available at Adding here full YAML here also.
NOTES:
|
|
I have two comments: First of all I thinks in most setups traefik should be in a separate For the traefik labels there are a view options in the new traefik versions which enable you to configure more of these options globally and omit them for the containers. If you have a traefik configuration like this (sorry I don't have a configuration with labels at hand):
you can ommit the following lables:
you can also ommit:
as there is only one port exposed by Nextcloud, but I think it can still be useful to write this here anyway for documentation purposes. |
|
Hi, As you said if we deploy traefik with a different docker-compose.yml then we need to configure two networks for nextcloud. I just keep the config simple for nextcloud deployment only. Yes, we can omit We must set
Ref: https://docs.traefik.io/https/acme/#the-different-acme-challenges
I removed
I added |
|
Why cant we fix the problem where the problem is caused from? An environmental variable telling nextcloud that it is behind a reverse-proxy and should behave properly. I should not have to have two route stacks to work around nextcloud trying to "help" me by refusing to act properly in the manner it should be doing so. Very few people place nextcloud as their https facing application, the overwhelming majority put it behind a reverseproxy. @JanoschDeurer are those labels suppose to work? |
|
@Motophan |
|
@ismailyenigul The first persons labels will not route, your labels not pass the trusted ssl cert. The problem is the labels posted in this thread. Delete them. |
|
@Motophan Also you mention about |
|
fam lmao that wont werk xDDDDDDDDD now, if you take his compose file and add under lables But we should not do this. Nextcloud should fix thier crap "sekur" features and let me pass an env variable that will let me send a reverseproxy at it and be done w/ this. Why do they make this harder than it should. |
|
Are you aware of Check https://docs.traefik.io/providers/docker/#exposedbydefault
And this is config from my traefik container deployment
|
|
@Motophan I created this ticket to document nextcloud specific lables for Traefik 2.0. There are other lables required as well, as you can see in the examples of @ismailyenigul. An example of such labels is given by him, however the labels for you really depend on your Traefik setup. Setting
is totally fine. I also don't understand what your problem with "Nextclouds crap sekur features" my traefik config is working fine and I never had any problem running Nextclound behind a reverse proxy. |
|
@ismailyenigul Thanks for creating all these examples :) My intention was that you can also create multiple networks in a single The cert resolver works for me with the above config without setting it for each container as it is configured as a default resolver. So I think we can omit the resolver. |
|
Here is my configuration with an external traefik 2 instance running withing the http_network namespace. Note: Within this config bind volume mounts are used. Adapt to your use-case... version: '3'
networks:
http_network:
external: true
nextcloud_network:
external: false
services:
db:
image: postgres:12-alpine
container_name: nextcloud-db
restart: unless-stopped
volumes:
- /data/<service_name>/db:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=<db_password>
- POSTGRES_DB=nextcloud
- POSTGRES_USER=nextcloud
networks:
- nextcloud_network
app:
image: nextcloud:18
container_name: nextcloud-app
restart: unless-stopped
labels:
- traefik.enable=true
- traefik.http.services.<service_name>.loadbalancer.server.port=80
- traefik.http.routers.<service_name>.rule=Host(`<url>`)
- traefik.http.routers.<service_name>.middlewares=<service_name>,<service_name>_redirect
- traefik.http.routers.<service_name>.entrypoints=websecure
- traefik.http.middlewares.<service_name>.headers.stsSeconds=155520011
- traefik.http.middlewares.<service_name>.headers.stsIncludeSubdomains=true
- traefik.http.middlewares.<service_name>.headers.stsPreload=true
- traefik.http.middlewares.<service_name>.headers.contentTypeNosniff=true
- traefik.http.middlewares.<service_name>.headers.browserXSSFilter=true
- traefik.http.middlewares.<service_name>_redirect.redirectregex.permanent=true
- traefik.http.middlewares.<service_name>_redirect.redirectregex.regex=/.well-known/(card|cal)dav
- traefik.http.middlewares.<service_name>_redirect.redirectregex.replacement=/remote.php/dav/
environment:
- POSTGRES_HOST=db
- NEXTCLOUD_TRUSTED_DOMAINS=<url>
- TRUSTED_PROXIES=172.16.0.0/12
depends_on:
- db
volumes:
- /data/<service_name>/data:/var/www/html
networks:
- nextcloud_network
- http_network |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

I didn't know where to put this, so sorry if this is the wrong place. I have a setup of traefik 2 and Nextcloud and wanted to know where I could add it in the documentation. There is some documentation for Traefik 1 in the manual of Nextcloud:
https://docs.nextcloud.com/server/18/admin_manual/configuration_server/reverse_proxy_configuration.html?highlight=traefik#traefik
In this location I could certainly add the documentation for the reverse proxy settings in traefik 2, however there are a lot of other settings that are recommended by Nextcloud that should also be set. My current config looks like this:
If you want to add this to the documentation and tell me where to put it, I am happy to write a PR. Also if anyone has any feedback about my configuration I would appreciate it.