changed pathprefix to file type matching

This commit is contained in:
root
2025-07-16 17:08:58 +00:00
parent 0ceea61510
commit b396902370

View File

@@ -3,7 +3,7 @@ services:
media:
image: nginx:1.27-alpine
restart: unless-stopped
container_name: mindboost-media-server
volumes:
- ./nginx/html:/usr/share/nginx/html:ro
- ./nginx/conf.d:/etc/nginx/conf.d:ro
@@ -13,7 +13,7 @@ services:
- traefik.enable=true
# Route: https://b.mindboost.team/media (optionally with /anything/after/that)
- traefik.http.routers.media.rule=Host(`b.mindboost.team`) && PathPrefix(`/media`)
- traefik.http.routers.media.rule=Host(`b.mindboost.team`) && PathRegexp(`\.(mp3|aac|m4a|ogg|aac|opus|flac|wav)$`)
# Strip /media from the request *before* it reaches Nginx,
# so Nginx still serves /index.html, /css/site.css, etc.
@@ -22,13 +22,13 @@ services:
# TLS via the proxys “websecure” entrypoint
- traefik.http.routers.media.entrypoints=websecure
- traefik.http.routers.media.tls.certresolver=letsencrypt
- traefik.http.routers.media.tls.certresolver=http_resolver
# Upstream container port
- traefik.http.services.media.loadbalancer.server.port=80
networks:
- swarmproxy
- proxy
networks:
swarmproxy:
proxy:
external: true