Hello,
I am configuring traefik to access my api in https. I have the impression that it works since I don't see any errors in the logs and I can access my whoami in https too. But every time I use my front-end url (https://dspace.localhost), I get a Bad Gateway error.
here are the contents of my traefik.yml file:
version: "3.9"
services:
traefik:
image: "traefik:v2.9.6"
container_name: "traefik"
command:
- "--entrypoints.http.address=:80"
- "--entrypoints.https.address=:443"
- "--entrypoints.postgres.address=:5432"
- "--api.insecure=true"
- "--api.dashboard=true"
- "--providers.docker=true"
- "--providers.docker.swarmmode=true"
- "--providers.docker.network=traefik-net"
- "--providers.docker.exposedbydefault=false"
- "--providers.file.filename=/configuration/certificate.yml"
- "--providers.file.watch=true"
ports:
- "80:80"
- "8888:8080"
- "443:443"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "/C/opt/Savoirs_udes_project/DSpace7/volumes/configuration/:/configuration/"
whoami:
image: "traefik/whoami"
deploy:
labels:
- "traefik.enable=true"
- "traefik.http.routers.whoami.rule=Host(`whoami.localhost`)"
- "traefik.http.routers.whoami.entrypoints=https"
- "traefik.http.services.whoami.loadbalancer.server.port=80"
- "traefik.http.routers.whoami.tls=true"
networks:
- traefik-net
networks:
traefik-net:
driver: overlay
external: true
dspace:
driver: overlay
external: true
certificate.yml:
tls:
certificates:
certFile = "/C/opt/Savoirs_udes_project/DSpace7/volumes/tls/local-cert.crt"
keyFile = "/C/opt/Savoirs_udes_project/dSpace7/volumes/tls/local-key.key"
my_front-end.yml:
version: '3.9'
networks:
dspace:
driver: overlay
external: true
traefik-net:
driver: overlay
external: true
services:
dspace-angular:
environment:
DSPACE_UI_SSL: 'true'
DSPACE_UI_HOST: dspace.localhost
DSPACE_UI_PORT: '4000'
DSPACE_UI_NAMESPACE: /
DSPACE_REST_SSL: 'true'
DSPACE_REST_HOST: dspace-api.localhost
DSPACE_REST_PORT: 443
DSPACE_REST_NAMESPACE: /server
NODE_OPTIONS: "--max-old-space-size=5120"
image: thir2608/savoirs_front:latest
build:
context: ..
dockerfile: Dockerfile
networks:
- dspace
- traefik-net
deploy:
labels:
- "traefik.enable=true"
- "traefik.http.routers.dspace-angular.entrypoints=https"
- "traefik.http.routers.dspace-angular.rule=Host(`dspace.localhost`)"
- "traefik.http.routers.dspace-angular.service=dspace-angular"
- "traefik.http.services.dspace-angular.loadbalancer.server.port=4000"
- "traefik.http.routers.dspace-angular.tls=true"
Thanks for your help.