Hi there!
I’m trying to install nextcloud-aio running behind traefik3.
I’m discovering docker and successfully installed containers for my website and Dolibarr.
I followed the recommandations but I still have a “Bad Gateway” response (there’s something I did bad, for sure!).
Here is my docker-compose.yml:
services:
nextcloud-aio-mastercontainer:
image: nextcloud/all-in-one:latest
init: true
restart: always
container_name: nextcloud-aio-mastercontainer
volumes:
- ./nextcloud_aio_mastercontainer:/mnt/docker-aio-config
- /var/run/docker.sock:/var/run/docker.sock:ro
ports:
- 8080:8080
networks:
- netraefik
environment: # Is needed when using any of the options below
- APACHE_PORT=11000
- APACHE_IP_BINDING=0.0.0.0 # tried with localhost and 127.0.0.1
- APACHE_ADDITIONAL_NETWORK=netraefik
- SKIP_DOMAIN_VALIDATION=true
labels:
- "traefik.enable=true"
- "traefik.docker.network=netraefik"
networks:
netraefik:
external: true
Here is my traefik’s docker-compose.yml
networks:
netraefik:
external: true
services:
traefik:
image: "traefik:latest"
container_name: "traefik"
restart: always
command:
- "--api=true"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
ports:
- "80:80"
- "8086:8080"
- "443:443"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./traefik.toml:/etc/traefik/traefik.toml"
- "./nextcloud:/config"
- "./acme.json:/acme.json"
networks:
- netraefik
labels:
- "traefik.docker.network=netraefik"
My traefik.toml:
[api]
dashboard = true
insecure = true
[entryPoints]
[entryPoints.web]
address = ":80"
[entryPoints.web.http]
[entryPoints.web.http.redirections]
[entryPoints.web.http.redirections.entryPoint]
to = "websecure"
scheme = "https"
permanent = true
[entryPoints.websecure]
address = ":443"
[entryPoints.websecure.http.tls]
certResolver = "default"
[providers]
[providers.docker]
watch = true
exposedByDefault = false
network = "netraefik"
[providers.file]
directory = "/config"
watch = true
[certificatesResolvers]
[certificatesResolvers.default]
[certificatesResolvers.default.acme]
email = "postmaster@example.com"
storage = "./acme.json"
caServer = "https://acme-v01.api.letsencrypt.org/directory"
[certificatesResolvers.default.acme.tlsChallenge]
And so my nextcloud/nextcloud.yaml:
http:
routers:
nextcloud:
rule: "Host(`next.example.com`)"
entrypoints:
- "websecure"
service: nextcloud
middlewares:
- nextcloud-chain
tls:
certresolver: "letsencrypt"
services:
nextcloud:
loadBalancer:
servers:
- url: "http://localhost:11000"
middlewares:
nextcloud-secure-headers:
headers:
hostsProxyHeaders:
- "X-Forwarded-Host"
referrerPolicy: "same-origin"
https-redirect:
redirectscheme:
scheme: https
nextcloud-chain:
chain:
middlewares:
- https-redirect
- nextcloud-secure-headers
I can reach it on http://SERVER_IP:8080 but on https://next.example.com I have a Bad gateway… Everything seems fine in Traefik’s dashboard (nextcloud@file routed to http://localhost:11000)
If someone could help me! Thank you very much!