Question
Hi,
I have installed wikijs with Docker and I can run it normally inside my network, but if I access trough Traefik proxy I get a "Bad Gateway" error.
My Traefik is running other Docker instances with no issues. Here's my configuration:
Host Info (please complete the following information):
OS: Centos 8, Docker
Wiki.js version: 2.0.12
Database engine: MariaDB 10.4.10
Traefik version: 1.7.16
Traefik labels:
Make sure wiki.is runs properly without a reverse proxy first, then add Traefik. Error 502 simply means Wiki.js cannot be reached, most likely due to an incorrect configuration. Check the logs of wiki container and you'll quickly find out the issue.
@gruesomehit For the record, It works like a charm for me (HTTP and HTTPS)
Traefik + Wiki js
This is my compose
version: "3"
services:
db:
image: postgres:11-alpine
environment:
POSTGRES_DB: XXXXXXXXXX
POSTGRES_PASSWORD: XXXXXXXXXX
POSTGRES_USER: XXXXXXXXXX
logging:
driver: "none"
restart: unless-stopped
networks:
- internal
labels:
- traefik.enable=false
volumes:
- db-data:/var/lib/postgresql/data
wiki:
image: requarks/wiki:2.0.12
depends_on:
- db
environment:
DB_TYPE: postgres
DB_HOST: db
DB_PORT: 5432
DB_USER: wikijs
DB_PASS: XXXXXXXXXX
DB_NAME: XXXXXXXXXX
restart: unless-stopped
ports:
- 3000
labels:
- traefik.backend=wikijs
- traefik.frontend.rule=Host:MY.WIKI.TLD
- traefik.docker.network=proxy
- traefik.port=3000
networks:
- internal
- proxy
volumes:
db-data:
networks:
proxy:
external: true
internal:
external: false
I have 2 Network (always, for each compose)
As skapin suggest I made me a mess with the Traefik network. The traefik.port label must be always 3000
Here you can see a good example what I say:
https://stackoverflow.com/questions/49417889/traefik-bad-gateway-error-502-for-some-containers
I'll rewrite my docker-compose file about both networks taking your compose file as a good example.
Thanks everyone for your kindly help.
Here is a full working example:
https://ibuildit.io/how-to-install-wiki-js-via-docker-compose-with-traefik-2/