codecentric / spring-boot-admin

Admin UI for administration of spring boot applications
Apache License 2.0
12.39k stars 3.08k forks source link

White screen when route with traefik #3144

Closed Jolymmiles closed 7 months ago

Jolymmiles commented 9 months ago

Spring Boot Admin Server information

Description

I have traefik to route all reqeusts via domain and subdomain names, my java spring server works fine and i can go to swagger page via domain. Also Spring Boot Admin Server maybe work fine, but problem in white screen when i come into page of spring boot admin server. Its just nothig, also a have ssl, but browser said what page dont have them.

compose.yaml

version: '3.8'
services:
  admin:
    build:
      context: .
      dockerfile: Dockerfile
    volumes:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    expose:
      - 8081
    environment:
      - PORT=8081
      - SECURITY_USER=admin
      - SECURITY_PASSWORD=admin
      - TELEGRAM_NOTIFICATION=true
    restart: unless-stopped
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.backend-admin.rule=Host(`admin.example.com`)"
    networks:
      - proxy

networks:
  proxy:
    external: true
andreasfritz commented 9 months ago

Please take a look at the following example: https://github.com/codecentric/spring-boot-admin-runtime-playground/tree/main/nginx It shows a Spring Boot Admin and a Hello World app behind an nginx proxy.

Jolymmiles commented 9 months ago

Please take a look at the following example: https://github.com/codecentric/spring-boot-admin-runtime-playground/tree/main/nginx It shows a Spring Boot Admin and a Hello World app behind an nginx proxy.

I try, but its not help( How i send, my applications on other port 8080, 8081, but i also add specifying for traefik but stiil have white screen. My compose:

version: '3.8'
services:
  admin:
    build:
      context: .
      dockerfile: Dockerfile
    volumes:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    expose:
      - 8081
    environment:
      - PORT=8081
      - SECURITY_USER=admin
      - SECURITY_PASSWORD=admin
    restart: unless-stopped
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.backend-admin.rule=Host(`admin.example.com`)"
      - "traefik.http.services.backend-admin.loadbalancer.server.port=8081"
    networks:
      - proxy
networks:
  proxy:
    external: true

if i will use http it will work, but i wanna https

erikpetzold commented 9 months ago

Hi @Jolymmiles

where do you want to terminate the ssl connection? In traefik or in Spring Boot Admin server?

Probably you are missing some more labels like

- "traefik.http.routers.backend-admin-tls.tls=true"
- "traefik.http.routers.backend-admin-tls.entrypoints=https"
- "traefik.http.routers.backend-admin-tls.rule=Host(`admin.example.com`)"

We're no traefik experts but have seen things like this in other projects.


Besides ssl, please make sure the requests for frontend resources are going to the correct url. Therefore the public-url property must be set corretly (see example linked above). You can check that for example in the network tab of the browser dev tools.

erikpetzold commented 7 months ago

closed du to missing feedback