0
I have setup a traefik container which is providing the proxy services for my owncloud docker container. However, when I start my owncloud container I get 'Bad Gateway' error when I browse to http://example.xlxl.co.uk. The http to https redirections is working fine, so is the Lets Encrypt SSL integrtion. In addition to this if i go to http://traefik.xlxl.co.uk, I can also see the traefik dashboard, however when i go to the URL for my owncloud container (http://example.xlxl.co.uk) I get 'Bad Gateway'....I have tried many different things now, exposing ports within the owncloud docker-compose file etc. but to no avail...and now completely lost. The traefik container is setup with the following configuration for docker-compose.yml
version: '2'
services:
proxy:
# You might want to use a proper version
image: traefik
command: --configFile=/traefik.toml
restart: unless-stopped
# Here's the network we created:
networks:
- web
# The traefik entryPoints
ports:
- "80:80"
- "443:443"
- "8080:8080"
labels:
- "traefik.enable=true"
- "traefik.backend=traefik"
- "traefik.frontend.rule=Host:traefik.xlxl.co.uk"
# Traefik will proxy to its own GUI.
- "traefik.port=8080"
- "traefik.docker.network=web"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /opt/traefik/traefik.toml:/traefik.toml
- /opt/traefik/acme.json:/acme.json
networks:
web:
external: true
And the traefik.toml is as below
logLevel = "DEBUG"
defaultEntryPoints = ["https","http"]
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
minVersion = "VersionTLS12"
[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "xlxl.co.uk"
watch = true
exposedbydefault = false
network = "web"
[acme]
email = "edy@xlxl.co.uk"
storage = "/acme.json"
entryPoint = "https"
[acme.tlsChallenge]
onDemand = true
onHostRule = true
acmeLogging = true
caServer = "https://acme-staging.api.letsencrypt.org/directory"
[[acme.domains]]
main = "xlxl.co.uk"
sans = ["example.xlxl.co.uk"]
# enable web configuration backend.
[api]
entryPoint = "traefik"
dashboard = true
address = ":8080"
And the the owncloud docker container's docker-compose.yml configuration as below:
version: '2.1'
services:
owncloud:
image: 'owncloud/server:${OWNCLOUD_VERSION}'
restart: always
depends_on:
- db
- redis
environment:
- 'OWNCLOUD_DOMAIN=${OWNCLOUD_DOMAIN}'
- OWNCLOUD_DB_TYPE=mysql
- OWNCLOUD_DB_NAME=owncloud
- OWNCLOUD_DB_USERNAME=owncloud
- OWNCLOUD_DB_PASSWORD=owncloud
- OWNCLOUD_DB_HOST=db
- 'OWNCLOUD_ADMIN_USERNAME=${ADMIN_USERNAME}'
- 'OWNCLOUD_ADMIN_PASSWORD=${ADMIN_PASSWORD}'
- OWNCLOUD_MYSQL_UTF8MB4=true
- OWNCLOUD_REDIS_ENABLED=true
- OWNCLOUD_REDIS_HOST=redis
networks:
- web
- internal
healthcheck:
test: [CMD, /usr/bin/healthcheck]
interval: 30s
timeout: 10s
retries: 5
volumes:
- '/opt/ownCloud/data:/var/www/html/data'
- '/opt/ownCloud/config:/var/www/html/config'
labels:
- traefik.enable=true
- traefik.frontend.rule=Host:example.xlxl.co.uk
- traefik.port=80
- traefik.docker.network=web
db:
image: 'webhippie/mariadb:latest'
restart: always
environment:
- MARIADB_ROOT_PASSWORD=owncloud
- MARIADB_USERNAME=owncloud
- MARIADB_PASSWORD=owncloud
- MARIADB_DATABASE=owncloud
- MARIADB_MAX_ALLOWED_PACKET=128M
- MARIADB_INNODB_LOG_FILE_SIZE=64M
networks:
- internal
healthcheck:
test: [CMD, /usr/bin/healthcheck]
interval: 30s
timeout: 10s
retries: 5
volumes:
- '/opt/ownCloud/mysql:/var/lib/mysql'
- '/opt/ownCloud/mysql/backup:/var/lib/backup'
labels:
- traefik.enable=false
redis:
image: 'webhippie/redis:latest'
restart: always
environment:
- REDIS_DATABASES=1
networks:
- internal
healthcheck:
test: [CMD, /usr/bin/healthcheck]
interval: 30s
timeout: 10s
retries: 5
volumes:
- '/opt/ownCloud/redis:/var/lib/redis'
labels:
- traefik.enable=false
networks:
web:
external: true
internal: