Hi,
I am new to Traefik but want to replace my current Nginx (jwilder).
I have installed Traefik v2 in docker with the following docker-compose.yml
with Lets Encrypt
version: '3'
services:
traefik:
image: traefik:v2.2
restart: always
ports:
- 80:80
- 443:443
- 8080:8080
networks:
- web
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /data/disk1/traefik/traefik.yml:/traefik.yml
- /data/disk1/traefik/acme.json:/acme.json
container_name: traefik
networks:
web:
external: true
I have setup Confluence on one domain and docker-compose.yml
version: "3"
services:
confluence:
container_name: confluence
image: atlassian/confluence-server:7.6.2
volumes:
- /data/disk1/atlassian/application-data/confluence:/var/atlassian/application-data/confluence
ports:
- "8090:8090"
external_links:
- postgres:postgres
environment:
- CATALINA_CONNECTOR_PROXYNAME=confluence.mydomain.com
- CATALINA_CONNECTOR_PROXYPORT=443
- CATALINA_CONNECTOR_SCHEME=https
- CATALINA_CONNECTOR_SECURE=true
labels:
- traefik.enable=true
- traefik.http.routers.confluence.rule=Host(`confluence.mydomain.com`)
- traefik.http.routers.confluence.tls=true
- traefik.http.routers.confluence.tls.certresolver=le
- traefik.http.routers.confluence.service=confluence
- traefik.http.services.confluence.loadbalancer.server.port=8090
networks:
- web
restart: always
networks:
web:
external:
name: web
It works fine and I also have NextCloud working on the same TLD.
But when trying to spin up a simple Nginx website on another domain is doesn't work.
The docker-compose.yml
version: "3"
services:
another-domain-web:
container_name: another-domain-web
image: nginx:latest
volumes:
- /data/disk1/another-domain/www/:/usr/share/nginx/html:ro
- /data/disk1/another-domain/conf/nginx.conf:/etc/nginx/nginx.conf:ro
ports:
- 9999:80
labels:
- traefik.enable=true
- traefik.http.routers.another-domain-web.rule=Host(`another-domain.com`)
- traefik.http.routers.another-domain-web.tls=true
- traefik.http.routers.another-domain-web.tls.certresolver=le
- traefik.http.routers.another-domain-web.service=another-domain-web
- traefik.http.services.another-domain-web.loadbalancer.server.port=9999
networks:
- web
restart: always
networks:
web:
external:
name: web
In Traefik it looks good I think (see screenshots below)
But when requesting http://another-domain.com/ I get redirected to https://another-domain.com/ and getting "Bad Gateway"
I see in acme that certificate is received and the browser tells it is valid.
Any hints to resolve this?