1. The problem I’m having:
I have to use http version 1.0 protocol for an odd requirement of cloudflare cache reserve (Why is my dynamic content being sent with chunked encoding · Cloudflare Support docs)
I am using Caddy Docker Proxy GitHub - lucaslorentz/caddy-docker-proxy: Caddy as a reverse proxy for Docker that routes to my php apache container. I am able to use http 1.0 in apache, but caddy responds with http 2.0 even though the apache server responds with 1.0. I need caddy to honor the protocol version of apache (which can be different based on request (1.0,1.1,2.0).
2. Error messages and/or full log output:
Responses from caddy reverse proxy using http 2.0
3. Caddy version:
/ # caddy version
v2.6.4 h1:2hwYqiRwk1tf3VruhMpLcYTg+11fCdr8S3jhNAdnPy8=
4. How I installed and ran Caddy:
docker caddy proxy (GitHub - lucaslorentz/caddy-docker-proxy: Caddy as a reverse proxy for Docker)
a. System environment:
ubuntu using docker
b. Command:
runs via docker compose
c. Service/unit/compose file:
app:
logging:
driver: "local"
deploy:
mode: global
restart_policy:
condition: any
placement:
constraints: [node.labels.app == true]
labels:
caddy: "http://"
caddy.reverse_proxy.trusted_proxies: "private_ranges"
caddy.reverse_proxy: "{{upstreams}}"
caddy.reverse_proxy.transport: "http"
caddy.reverse_proxy.transport.versions: "1.0"
d. My complete Caddy config:
{
"admin": {
"listen": "tcp/10.200.200.8:2019"
},
"apps": {
"http": {
"servers": {
"srv0": {
"listen": [
":80"
],
"routes": [
{
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "reverse_proxy",
"trusted_proxies": [
"192.168.0.0/16",
"172.16.0.0/12",
"10.0.0.0/8",
"127.0.0.1/8",
"fd00::/8",
"::1"
],
"upstreams": [
{
"dial": "lync_redirect_lync_vidapay:80"
}
]
}
]
}
]
}
],
"match": [
{
"host": [
"lync.vidapay.com"
]
}
],
"terminal": true
},
{
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "reverse_proxy",
"trusted_proxies": [
"192.168.0.0/16",
"172.16.0.0/12",
"10.0.0.0/8",
"127.0.0.1/8",
"fd00::/8",
"::1"
],
"upstreams": [
{
"dial": "lync_app_background:80"
}
]
}
]
}
]
}
],
"match": [
{
"host": [
"app.lyncpos.com",
"lync.vidapay.com",
"lync.vidapay.*.tcetra.dev"
],
"path": [
"/index.php/cron/*"
]
},
{
"host": [
"app.lyncpos.com",
"lync.vidapay.com",
"lync.vidapay.*.tcetra.dev"
],
"path": [
"/PHP-Point-Of-Sale-Prev/index.php/cron/*"
]
},
{
"host": [
"app.lyncpos.com",
"lync.vidapay.com",
"lync.vidapay.*.tcetra.dev"
],
"path": [
"/index.php/ecommerce/manual_sync"
]
},
{
"host": [
"app.lyncpos.com",
"lync.vidapay.com",
"lync.vidapay.*.tcetra.dev"
],
"path": [
"/index.php/background/*"
]
},
{
"host": [
"app.lyncpos.com",
"lync.vidapay.com",
"lync.vidapay.*.tcetra.dev"
],
"path": [
"/PHP-Point-Of-Sale-Prev/index.php/background/*"
]
},
{
"host": [
"lync.vidapay.com",
"lync.vidapay.*.tcetra.dev"
],
"path": [
"/index.php/ecommerce/cron"
]
}
],
"terminal": true
},
{
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "reverse_proxy",
"transport": {
"protocol": "http",
"versions": [
"1.0"
]
},
"trusted_proxies": [
"192.168.0.0/16",
"172.16.0.0/12",
"10.0.0.0/8",
"127.0.0.1/8",
"fd00::/8",
"::1"
],
"upstreams": [
{
"dial": "lync_app:80"
}
]
}
]
}
]
}
],
"terminal": true
}
]
}
}
}
}
}