- Install Docker
- Install a debugging-friendly HTTP client (e.g. https://httpie.org/ )
- Enable Swarm Mode:
docker swarm init - Deploy the stack:
docker stack up -c stack.yaml http- This will listen on port 2100 & 2101
- Access endpoints
:2101/yeswith an extra headerX-Forwarded-Proto: https:
# With httpie:
http :2101/yes x-forwarded-proto:https show_env==1
# With curl:
curl 127.0.0.1:2101/yes -H x-forwarded-proto:https:2101/yesshould respond withyes https, which is configured as direct_response
:2101/yesresponds withyes
- Accessing endpoint
:2101/bin/headers?show_env=1returns all headers sent from Envoy to httpbin. Which shows that headerX-Forwarded-Protois overwritten.