Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS not working when root domain not accessible #1406

Open
brandonfl opened this issue May 3, 2024 · 0 comments
Open

CSS not working when root domain not accessible #1406

brandonfl opened this issue May 3, 2024 · 0 comments

Comments

@brandonfl
Copy link

brandonfl commented May 3, 2024

Hello,

Description

I am trying to create a miniserve with basicauth by path, for example :

  • url.com/toto => basicauth user:a password:a
  • url.com/titi => basicauth user:b password:b

But

  • url.com/ => should not be accessible

Problem

The CSS do not work as it try to get it from "url.com/CSS" but the access to "url.com/" is denied

How to repro

Here how I am doing with traefik :

Spoiler
labels:
# service
traefik.enable: "true"
traefik.http.services.miniserve.loadbalancer.server.port: "8080"

# test
traefik.http.routers.miniserve-test.rule: "Host(`url.com`) && PathPrefix(`/test`)"
traefik.http.routers.miniserve-test.tls: "true"
traefik.http.routers.miniserve-test.entrypoints: "web-secure"
traefik.http.routers.miniserve-test.service: "miniserve"
traefik.http.routers.miniserve-test.middlewares: "miniserve-test-auth, contentCompression@file, autodetectContenttype@file"
traefik.http.middlewares.miniserve-test-auth.basicauth.removeheader: true
traefik.http.middlewares.miniserve-test-auth.basicauth.users: "..."

# toto
traefik.http.routers.miniserve-toto.rule: "Host(`url.com`) && PathPrefix(`/toto`)"
traefik.http.routers.miniserve-toto.tls: "true"
traefik.http.routers.miniserve-toto.entrypoints: "web-secure"
traefik.http.routers.miniserve-toto.service: "miniserve"
traefik.http.routers.miniserve-toto.middlewares: "miniserve-toto-auth, contentCompression@file, autodetectContenttype@file"
traefik.http.middlewares.miniserve-toto-auth.basicauth.removeheader: true
traefik.http.middlewares.miniserve-toto-auth.basicauth.users: "..."

Possible solution

Is there a way to make the css file accessible to all path even if the / is not accessible ?
Like having the CSS in relative path ?

Thanks in advance,
BrandonFL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant