Hello,
I have some trouble to implement a keycloak behind traefik.
main.tsx:13 Mixed Content: The page at 'https://keycloak.example.com/admin/master/console/' was loaded over HTTPS, but requested an insecure resource 'http://keycloak.example.com/resources/master/admin/en'. This request has been blocked; the content must be served over HTTPS.
loadUrl @ index.js:70
read @ index.js:52
read @ i18next.js:1544
loadOne @ i18next.js:1574
(anonymous) @ i18next.js:1559
prepareLoading @ i18next.js:1558
load @ i18next.js:1563
loadResources @ i18next.js:1871
o @ i18next.js:1976
changeLanguage @ i18next.js:1989
c @ i18next.js:1839
setTimeout
init @ i18next.js:1844
(anonymous) @ main.tsx:13Understand this error
keycloak.js:57 Refused to frame 'http://keycloak.example.com/' because it violates the following Content Security Policy directive: "frame-src 'self'".
So I can’t see the page….
services:
keycloak:
image: quay.io/keycloak/keycloak:latest
networks:
- traefik_proxy
environment:
- "TZ=Europe/Luxembourg"
- "KC_BOOTSTRAP_ADMIN=admin"
- "KC_BOOTSTRAP_ADMIN_PASSWORD=admin"
- "KC_HOSTNAME=keycloak.example.com"
- "PROXY_ADDRESS_FORWARDING=true"
- "KC_DB=mariadb"
- "KC_DB_URL_HOST=galera-cluster.example.com"
- "KC_DB_SCHEMA=keycloak"
- "KC_DB_USERNAME=keycloak"
- "KC_DB_PASSWORD=keycloak"
- "KC_LOG_LEVEL=DEBUG"
volumes:
- "/etc/localtime:/etc/localtime:ro"
command:
- "start-dev"
deploy:
mode: replicated
replicas: 1
placement:
# Placement constraints restrict where Traefik tasks can run.
# Running on manager nodes is common for accessing the Swarm API via the socket.
constraints:
- node.role == manager
# Traefik Dynamic configuration via labels
# In Swarm, labels on the service definition configure Traefik routing for that service.
labels:
- "traefik.enable=true"
- "traefik.swarm.network=traefik_proxy"
# Keycloak router
- "traefik.http.routers.keycloak.rule=Host(`keycloak.example.com`)"
- "traefik.http.routers.keycloak.entrypoints=websecure"
- "traefik.http.routers.keycloak.tls=true"
- "traefik.http.routers.keycloak.tls.certresolver=le"
- "traefik.http.routers.keycloak.service=keycloak"
# Service hint
- "traefik.http.services.keycloak.loadbalancer.server.port=8080"
- "traefik.http.services.keycloak.loadbalancer.server.scheme=http"
networks:
traefik_proxy:
external: true
I have tried many things, like KC_PROXY=edge, middleware settings, but nothing works...
Does someone has an idea?
Regards,