Make Traefik a web server !
This is a plugin for Traefik to build a web server as a middleware.
Not the plugin we deserved, but the plugin we needed.
Just because you can, doesn't mean you should
Here is an example of a file provider dynamic configuration (given here in
YAML), where the interesting part is the http.middlewares
section:
# Dynamic configurationhttp:routers:my-waeb-router:rule: host(`waeb.localhost`)service: noop@internal # requiredmiddlewares:- traefik-plugin-waebmiddlewares:traefik-plugin-waeb:plugin:traefik-plugin-waeb:root: "/var/www/html/"
root
The root
parameter is the root directory of the web server.
There is a docker-compose.yml
file to test the plugin locally:
docker-compose up -d
Then, you can go to http://waeb.localhost to see the result.