I’m not sure if there’s a way to assign pipelines in a phoenix router other than by path, but you could put your plug into the endpoint.ex and redirect to different routers.
Edit: another option might be a plug, which does only apply another plug supplied in the options on demand.
plug :when_header, plug: MyAppWeb.SomePlug






















