Hi, When the path to the Eureka Dashboard is modified (e.g. eureka.dashboard.path: /eureka-dashboard), the static content fails to be fetch (css, js...). http://localhost:8761/eureka/css/wro.css -> 404 Not Found
Comment From: spencergibb
I'm not seeing the problem. When I set eureka.dashboard.path: /eureka-dashboard it doesn't actually change the location of the static resources. They are still at /eureka/*.
Comment From: 12010994
Damn. Actually I moved the dashboard default location to make room for the Spring Boot Admin dashboard. Do you think it could be related ?
Comment From: spencergibb
Unsure without seeing your project.
Comment From: twest72
I have the same error (run as spring boot jar).
Comment From: spencergibb
@twest72 like I told the reporter, I'm unable to duplicate. Do you have a project to share?
Comment From: vigohe
@spencergibb I do have the same issue but running it in a docker container. Runs fine in my local machine.
I did also upload the code to https://github.com/vigohe/eureka-issue, and you can check the docker image in https://hub.docker.com/r/vigohe/eureka/.
docker run --rm --name eureka -p 8761:8761 vigohe/eureka:issue
Hope this will help.
Comment From: vigohe
Sorry I miss the "touch /app.jar" command in the Dockerfile. That did the magic..
from https://spring.io/guides/gs/spring-boot-docker/
You can use a RUN command to "touch" the jar file so that it has a file modification time (Docker creates all container files in an "unmodified" state by default). This actually isn’t important for the simple app that we wrote, but any static content (e.g. "index.html") would require the file to have a modification time.
Comment From: 12010994
Here is a sample project : https://github.com/vpetit35/eureka-dashboard-css-issue
Comment From: 12010994
Well, I figured that this issue is not a bug from Eureka.
Actually when you put Spring boot admin and Eureka together, and set eureka.dashboard.path to /eureka-new-path, to have Spring boot admin on /, it will also overwride every others paths for his APIs.
So either you redirect every spring.boot.admin.___ api/url related confs to another path to free Eureka statics contents loading, or you put the whole spring boot admin context-path to something else (like /admin) and you do a servlet redirection of /admin to /.
Comment From: daniellavoie
If you are interested into a proper eureka dashboard for Spring Cloud, I would recommend you trying out the spring-cloud-dashboard from @VanRoy
https://github.com/VanRoy/spring-cloud-dashboard
With this one you can disable eureka and spring boot admin dashboards.
Comment From: spencergibb
Well, I figured that this issue is not a bug from Eureka.
Comment From: just3019
Hi, Where did I make a mistake?
Comment From: foxivolunteer
Hello. I configure eureka server as default configuration on my local machine with spring boot. when I deploy it into kubernetes, UI is not loading.
Comment From: vikramnagaraju31
@foxivolunteer
Hi, Were you able to resolve above issue, if yes can you please share us what needs to be done.
Comment From: abhinav82ify
@foxivolunteer, @vikramnagaraju31 I am facing the same issue. Was anyone able to fix this?
Comment From: ViliusS
Not sure why this ever get closed but it IS a bug in how static CSS and JS resources are served. Here https://github.com/spring-cloud/spring-cloud-netflix/blob/9e1f7f6aad9becbfdb42af4bd1960e87f1ee897c/spring-cloud-netflix-eureka-server/pom.xml#L172 generated static resources are copied to /static/eureka/ folder which is then served via HTTP server from /static/ folder. Since HTTP server serves these resources statically without modifying path you will always get them served under /eureka/ prefix. So currently eureka.dashboard.path is useless.
Comment From: heowc
hello,
I found out about this problem while using an embedded config server.
So, I simply thought that if we change the base-path, it would be good if the static resource path changes along with it. What do you think? 🤔
Comment From: ViliusS
If you are using Ingress or any other HTTP load balancer above Eureka there is a workaround for this issues. Just map both /eureka/ and /yourcustomdashboard/ paths to Eureka service. In Kubernetes it looks like this:
- backend:
service:
name: registry
port:
number: 8761
path: /eureka
pathType: Prefix
- backend:
service:
name: registry
port:
number: 8761
path: /yourcustomeurekawebui
pathType: Prefix