During a Hackathon I implemented a route-interception by HTTP Header value in Nginx-ingress for Kubernetes:
kind: ConfigMap
data:
http-snippet: |
map $http_x_feature_ucache $ucache_route_service {
default "$proxy_upstream_name";
'true' "default-cache-svc-3000";
}
annotations:
nginx.ingress.kubernetes.io/configuration-snippet: |
set $proxy_upstream_name $ucache_route_service;
This will cause the ingress to intercept requests with HTTP header X-Feature-UCache: true and re-route them to default-cache-svc-3000 (Namespace-Service-Port), thus, achieving a poor-man's content routing.