Basically, i would like to have a subdomain or path go to some public url such as a reddit page or google document, but i have no idea how i would do that.
pretend i want to go to the traefik subreddit, i would like the following to [separately] take me there
these should take me to https://www.reddit.com/r/Traefik/
how would i do this? it should also be easy to add more different paths or subdomains, as i will copy-paste the example for other links.
edit: to be clear, i would like to do this in a dynamic file
This is a job for the redirectRegex middleware.
I would make the regex very broad (
^.*$) and use it on the routes you want to redirect.
I have a ./rules/ directory for traefik, could you give me a couple of examples of a .toml or .y(a)ml that would do what I want?
rule: (Host(`t-reddit.mydomain.com`) || (host(`mydomain.com`) && Path(`/t-reddit`)))
# If you want a pemanent redirect
# permanent: true
- url: http://127.0.0.1:9999
Hey, thanks. I haven't used yaml files with traefik yet, but I think I understand how it works. (Looks much nicer than toml tho) and it works nicely!
Question: what is that dummy service for?
Your routers need a service. This is one way of providing that in a self contained fashion.
You could enable ping
--ping on traefik and then use the
ping@internal as the service instead.