spring-boot-admin icon indicating copy to clipboard operation
spring-boot-admin copied to clipboard

White screen when route with traefik

Open Jolymmiles opened this issue 1 year ago • 3 comments

Spring Boot Admin Server information

  • Version: 3.2.1

  • Spring Boot version: 3.2.2

  • Configured Security: basic auth

  • Webflux or Servlet application: How to find?

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

Jolymmiles avatar Feb 07 '24 16:02 Jolymmiles

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.

andreasfritz avatar Feb 09 '24 07:02 andreasfritz

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

Jolymmiles avatar Feb 09 '24 13:02 Jolymmiles

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 avatar Feb 16 '24 09:02 erikpetzold

closed du to missing feedback

erikpetzold avatar Mar 22 '24 08:03 erikpetzold