Start services:
docker-compose up
Test x-accel-redirect for POST requests:
curl -v -d '{"foo": 2}' http://localhost:8000/test
:8001 | |
log | |
header X-Accel-Redirect "/back" | |
respond "Proceed!" |
:8002 | |
log | |
respond "I'm back!" |
version: "3.5" | |
services: | |
front: | |
image: caddy:2.4.6 | |
restart: unless-stopped | |
ports: | |
- "8000:8000" | |
volumes: | |
- ./front:/etc/caddy/Caddyfile | |
depends_on: | |
- acl | |
- back | |
acl: | |
image: caddy:2.4.6 | |
restart: unless-stopped | |
ports: | |
- "8001:8001" | |
volumes: | |
- ./acl:/etc/caddy/Caddyfile | |
back: | |
image: caddy:2.4.6 | |
restart: unless-stopped | |
ports: | |
- "8002:8002" | |
volumes: | |
- ./back:/etc/caddy/Caddyfile |
:8000 | |
log | |
reverse_proxy * acl:8001 { | |
@accel header X-Accel-Redirect * | |
handle_response @accel { | |
rewrite {http.reverse_proxy.header.X-Accel-Redirect} | |
reverse_proxy back:8002 | |
} | |
} |