I don’t understand your question regarding sub-domain.
If you just have the issue that / shows a server page and you want it to redirect single / to /zabbix, then you could add a separate router.
An adaption from a post from this week:
- "traefik.http.routers.zabbixroot.rule=Host(`example.com`) && (Path(`/`)"
- "traefik.http.middlewares.zabbixroot.redirectregex.regex=.*"
- "traefik.http.middlewares.zabbixroot.redirectregex.replacement=https://example.com/zabbix"
- "traefik.http.routers.zabbixroot.middlewares=zabbixroot"
- "traefik.http.routers.zabbixroot.service=noop@internal"
(Sorry, this is for CLI, you need to change it to yaml format.)
It creates a router and a middleware both with name zabbixroot.
Only when / is requested, it will tell the browser to change to /zabbix. All other requests should go to their original path. Remove add-zabbixpath middleware from other router.