Routing to specific pod or container

Hi there, can I specify routing to specific replica of pod in k8s or specific container in docker-compose at runtime?
I have a web api with local state and I need to connect specific users to this instance for example if in request header "X-app-instance" equals to pod name, then I need to be sure that all requests with this header connects to specific pod.