Create a router rule (with backticks):
Host(`example.com`) && PathPrefix(`/app1`)
and an according service. Either manually in a dynamic config file or with Configuration Discovery with labels. Check simple Traefik example.
Caveat: most web apps don’t like to be placed on a path, as they usually respond with absolute paths for redirect, links, scripts and images. It only works when you can set some kind of "base path" in the app. Therefore best practice is using sub-domains.
Next time please share your full Traefik static and dynamic config, and docker-compose.yml
if used.