Is there a way to serve static resources with Traefik?

Mathias Gilson picture Mathias Gilson · Sep 30, 2017 · Viewed 13.2k times · Source

I'd like to serve static ressources such as images, js bundles, html pages... with Traefik like I was able to do with nginx

# nginx config
server {
    root /www/data;

    location ~ \.js {
        root /www/bundles;
    }
}

Many thanks Cheers

Answer

ldez picture ldez · Sep 30, 2017

Traefik doesn't serve static files (it's a not a web server it's a reverse proxy/load balancer).

You must use a container, which contains a web server with your files.