1
0
Fork 0
docker-easy-haproxy/tests_e2e/docker/docker-compose-proxy-headers.yml
Joao Gilberto Magalhaes 776f216a36 Add support for proxy-awareness headers: X-Forwarded-For, X-Forwarded-Port, X-Forwarded-Proto, X-Forwarded-Host, and X-Request-ID
- Updated HAProxy configuration template to set all standard proxy headers for HTTP requests.
- Added support for a unique request ID via `unique-id-format` and `unique-id-header` directives.
- Implemented E2E tests for header validation, request correlation, and configuration correctness.
- Enhanced documentation to explain usage and examples of proxy headers.
- Updated CI workflows to include E2E tests for proxy headers.
2026-02-16 17:26:59 -05:00

46 lines
1.5 KiB
YAML

# ==============================================================================
# E2E TEST: Proxy Headers Verification
# ==============================================================================
#
# WHAT THIS DEMONSTRATES:
# - All 5 standard proxy headers are set correctly
# - X-Forwarded-For: Client IP address
# - X-Forwarded-Port: Port HAProxy received request on
# - X-Forwarded-Proto: Protocol (http or https)
# - X-Forwarded-Host: Original Host header from client
# - X-Request-ID: Unique request identifier (UUID)
# - HAProxy logs contain unique-id for request correlation
#
# ==============================================================================
services:
haproxy:
build:
context: ../..
dockerfile: build/Dockerfile
image: byjg/easy-haproxy:local
volumes:
- /var/run/docker.sock:/var/run/docker.sock
healthcheck:
test: ["CMD", "curl", "-f", "-u", "admin:password", "http://localhost:1936"]
interval: 10s
timeout: 5s
start_period: 30s
retries: 3
environment:
EASYHAPROXY_DISCOVER: docker
HAPROXY_USERNAME: admin
HAPROXY_PASSWORD: password
HAPROXY_STATS_PORT: 1936
ports:
- "80:80/tcp"
- "443:443/tcp"
- "1936:1936/tcp"
# Header echo server for testing - responds with all received headers
webapp:
build: ../fixtures/header-echo
labels:
easyhaproxy.http.host: test.local
easyhaproxy.http.port: 80
easyhaproxy.http.localport: 8080