Coolify + Caddy + Wordpress Permalinks Don't Work

Hi everybody.

1. The problem I’m having:

I’m trying to install a Wordpress site with Coolify using Caddy as the reverse-proxy. The website works with Wordpress “plain” URL format, but permalinks always return a 404 error.

Coolify defines the Caddy directives as docker labels in each website’s configuration, which you can see here:

caddy_1.encode=zstd gzip
caddy_1.handle_path.1_reverse_proxy={{upstreams 80}}
caddy_1.handle_path=/*
caddy_1.header=-Server
caddy_1.try_files={path} /index.php?{uri}
caddy_1=https://my-redacted-website.com
caddy_ingress_network=coolify

I’ve also tried editing the caddy_1.handle_path label by replacing the /* path with /app/*. But that causes Wordpress to return a blank page and then none of the visits even hit the HTTP server (i.e., there are no hits at all in the logs after making that change).

2. Error messages and/or full log output:

Caddy doesn’t return any errors in its own logs, which indicates Coolify’s Caddy directives are technically valid from Caddy’s perspective. But Coolify’s HTTP server returns the error below, which shows that Caddy is telling the HTTP server to get the Wordpress page/post from the /app directory in the file system (That’s where Cooify installs every website/app.), but of course Wordpress files are dynamically generated and not served from the file system.

[error] 37#37: *67 "/app/[wp-page-slug-redacted]/index.php" is not found (2: No such file or directory)

Also, why would Caddy’s default URLs for Wordpress produce a file path based on the Wordpress slug? That doesn’t make any sense.

How do I configure the Caddy directives inside Coolify’s Caddy labels to tell Caddy to stop directing the HTTP server to the file system for dynamically-generated Wordpress pages/posts, while also ensuring that static files like images, CSS, JS, etc. are retrieved from the file system as usual?

3. Caddy version:

Coolify pulls this Caddy docker image:

lucaslorentz/caddy-docker-proxy:2.8-alpine

4. How I installed and ran Caddy:

Coolify installs and manages the entire Caddy docker container, but it requires the docker labels to configure Caddy, as I described above.

a. System environment:

Ubuntu 24.04
Docker version 27.4.1, build b9d17ea

b. Command:

None

c. Service/unit/compose file:

None

d. My complete Caddy config:

This is what is defined in the Coolify docker config:

networks:
  coolify:
    external: true
  j8sw0kc84osgg0s0wg00oso8:
    external: true
services:
  caddy:
    container_name: coolify-proxy
    image: 'lucaslorentz/caddy-docker-proxy:2.8-alpine'
    restart: unless-stopped
    extra_hosts:
      - 'host.docker.internal:host-gateway'
    environment:
      - CADDY_DOCKER_POLLING_INTERVAL=5s
      - CADDY_DOCKER_CADDYFILE_PATH=/dynamic/Caddyfile
    networks:
      - coolify
      - j8sw0kc84osgg0s0wg00oso8
    ports:
      - '80:80'
      - '443:443'
      - '443:443/udp'
    labels:
      - coolify.managed=true
      - coolify.proxy=true
    volumes:
      - '/var/run/docker.sock:/var/run/docker.sock:ro'
      - '/data/coolify/proxy/caddy/dynamic:/dynamic'
      - '/data/coolify/proxy/caddy/config:/config'
      - '/data/coolify/proxy/caddy/data:/data'

Please help. I’ve tried dozens of different Caddy docker label directives, asked GPT/Gemini/Claude/etc. None of them know how to resolve this.

Could you add the contents below into your Caddyfile, restart, and post updated logs?

{
        debug
}
1 Like

Thank you for your reply. Here are the logs:

2025-01-21T22:25:57.897686458Z {"level":"info","ts":1737498357.892134,"logger":"docker-proxy","msg":"Running caddy proxy server"}
2025-01-21T22:25:57.906650868Z {"level":"info","ts":1737498357.9056835,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//127.0.0.1:2019","//localhost:2019","//[::1]:2019"]}
2025-01-21T22:25:57.906674576Z {"level":"info","ts":1737498357.9064121,"msg":"autosaved config (load with --resume flag)","file":"/config/caddy/autosave.json"}
2025-01-21T22:25:57.906681958Z {"level":"info","ts":1737498357.9064302,"logger":"docker-proxy","msg":"Running caddy proxy controller"}
2025-01-21T22:25:57.914422484Z {"level":"info","ts":1737498357.9136965,"logger":"docker-proxy","msg":"Start","CaddyfilePath":"/dynamic/Caddyfile","EnvFile":"","LabelPrefix":"caddy","PollingInterval":5,"ProxyServiceTasks":true,"ProcessCaddyfile":true,"ScanStoppedContainers":false,"IngressNetworks":"[]","DockerSockets":[""],"DockerCertsPath":[""],"DockerAPIsVersion":[""]}
2025-01-21T22:25:57.918452322Z {"level":"info","ts":1737498357.9158862,"logger":"docker-proxy","msg":"Caddy ContainerID","ID":"fcafdec37fc98d56e038802cca029782833aae78313321d2cb7a5b57b22da39c"}
2025-01-21T22:25:57.921508133Z {"level":"info","ts":1737498357.9189072,"logger":"docker-proxy","msg":"Connecting to docker events","DockerSocket":""}
2025-01-21T22:25:57.935787729Z {"level":"info","ts":1737498357.9355304,"logger":"docker-proxy","msg":"IngressNetworksMap","ingres":"map[2467f8c4d83cc1ea82aef7d9b57edc908f425e3afbe0cdebb000545853f9e27f:true a91d95ef33d5633fb51fae3c8f2f66ea3374a9197767e03db1c799b9cb5adf8e:true coolify:true j8sw0kc84osgg0s0wg00oso8:true]"}
2025-01-21T22:25:57.971414424Z {"level":"info","ts":1737498357.9687955,"logger":"docker-proxy","msg":"Swarm is available","new":false}
2025-01-21T22:25:58.010110928Z {"level":"info","ts":1737498358.009674,"logger":"docker-proxy","msg":"New Caddyfile","caddyfile":"import /dynamic/*.caddy\nhttp://d4g4kgo8k0ssw80g8s4ok40w.redacted-ip.sslip.io {\n\tencode zstd gzip\n\thandle_path /* {\n\t\treverse_proxy 10.0.0.11:80\n\t}\n\theader -Server\n\ttry_files {path} /index.html /index.php\n}\nhttp://howcwow4c8wocks0osog8okk.redacted-ip.sslip.io {\n\tencode zstd gzip\n\thandle_path /* {\n\t\treverse_proxy 10.0.0.10:80\n\t}\n\theader -Server\n\ttry_files {path} /index.html /index.php\n}\nhttp://redacted-domain.com {\n\tencode zstd gzip\n\thandle_path /* {\n\t\treverse_proxy 10.0.0.11:80\n\t}\n\theader -Server\n\ttry_files {path} /index.html /index.php\n}\nhttp://wordpress-awo48s8ss0cw4wg4ow0w88o4.redacted-ip.sslip.io {\n\tencode zstd gzip\n\thandle_path /* {\n\t\treverse_proxy 10.0.1.3\n\t}\n\theader -Server\n\ttry_files {path} /index.html /index.php\n}\nhttps://redacted-domain.com {\n\tencode zstd gzip\n\thandle_path /* {\n\t\treverse_proxy 10.0.0.10\n\t}\n\theader -Server\n\ttry_files {path} {path}/ /index.php?{query}\n}\n"}
2025-01-21T22:25:58.014427373Z {"level":"info","ts":1737498358.0140936,"logger":"docker-proxy","msg":"New Config JSON","json":"{\"logging\":{\"logs\":{\"default\":{\"level\":\"DEBUG\"}}},\"apps\":{\"http\":{\"servers\":{\"srv0\":{\"listen\":[\":443\"],\"routes\":[{\"match\":[{\"host\":[\"redacted-domain.com\"]}],\"handle\":[{\"handler\":\"subroute\",\"routes\":[{\"handle\":[{\"handler\":\"headers\",\"response\":{\"deferred\":true,\"delete\":[\"Server\"]}}]},{\"group\":\"group5\",\"handle\":[{\"handler\":\"rewrite\",\"uri\":\"{http.matchers.file.relative}\"}],\"match\":[{\"file\":{\"try_files\":[\"{http.request.uri.path}\",\"{http.request.uri.path}/\"]}}]},{\"group\":\"group5\",\"handle\":[{\"handler\":\"rewrite\",\"uri\":\"{http.matchers.file.relative}?{http.request.uri.query}\"}],\"match\":[{\"file\":{\"try_files\":[\"/index.php\"]}}]},{\"handle\":[{\"encodings\":{\"gzip\":{},\"zstd\":{}},\"handler\":\"encode\",\"prefer\":[\"zstd\",\"gzip\"]}]},{\"handle\":[{\"handler\":\"subroute\",\"routes\":[{\"handle\":[{\"handler\":\"rewrite\"}]},{\"handle\":[{\"handler\":\"reverse_proxy\",\"upstreams\":[{\"dial\":\"10.0.0.10:80\"}]}]}]}],\"match\":[{\"path\":[\"/*\"]}]}]}],\"terminal\":true},{\"handle\":[{\"handler\":\"subroute\",\"routes\":[{\"handle\":[{\"handler\":\"static_response\",\"status_code\":503}]}]}],\"terminal\":true}]},\"srv1\":{\"listen\":[\":80\"],\"routes\":[{\"match\":[{\"host\":[\"wordpress-awo48s8ss0cw4wg4ow0w88o4.redacted-ip.sslip.io\"]}],\"handle\":[{\"handler\":\"subroute\",\"routes\":[{\"handle\":[{\"handler\":\"headers\",\"response\":{\"deferred\":true,\"delete\":[\"Server\"]}}]},{\"handle\":[{\"handler\":\"rewrite\",\"uri\":\"{http.matchers.file.relative}\"}],\"match\":[{\"file\":{\"try_files\":[\"{http.request.uri.path}\",\"/index.html\",\"/index.php\"]}}]},{\"handle\":[{\"encodings\":{\"gzip\":{},\"zstd\":{}},\"handler\":\"encode\",\"prefer\":[\"zstd\",\"gzip\"]}]},{\"handle\":[{\"handler\":\"subroute\",\"routes\":[{\"handle\":[{\"handler\":\"rewrite\"}]},{\"handle\":[{\"handler\":\"reverse_proxy\",\"upstreams\":[{\"dial\":\"10.0.1.3:80\"}]}]}]}],\"match\":[{\"path\":[\"/*\"]}]}]}],\"terminal\":true},{\"match\":[{\"host\":[\"d4g4kgo8k0ssw80g8s4ok40w.redacted-ip.sslip.io\"]}],\"handle\":[{\"handler\":\"subroute\",\"routes\":[{\"handle\":[{\"handler\":\"headers\",\"response\":{\"deferred\":true,\"delete\":[\"Server\"]}}]},{\"handle\":[{\"handler\":\"rewrite\",\"uri\":\"{http.matchers.file.relative}\"}],\"match\":[{\"file\":{\"try_files\":[\"{http.request.uri.path}\",\"/index.html\",\"/index.php\"]}}]},{\"handle\":[{\"encodings\":{\"gzip\":{},\"zstd\":{}},\"handler\":\"encode\",\"prefer\":[\"zstd\",\"gzip\"]}]},{\"handle\":[{\"handler\":\"subroute\",\"routes\":[{\"handle\":[{\"handler\":\"rewrite\"}]},{\"handle\":[{\"handler\":\"reverse_proxy\",\"upstreams\":[{\"dial\":\"10.0.0.11:80\"}]}]}]}],\"match\":[{\"path\":[\"/*\"]}]}]}],\"terminal\":true},{\"match\":[{\"host\":[\"howcwow4c8wocks0osog8okk.redacted-ip.sslip.io\"]}],\"handle\":[{\"handler\":\"subroute\",\"routes\":[{\"handle\":[{\"handler\":\"headers\",\"response\":{\"deferred\":true,\"delete\":[\"Server\"]}}]},{\"handle\":[{\"handler\":\"rewrite\",\"uri\":\"{http.matchers.file.relative}\"}],\"match\":[{\"file\":{\"try_files\":[\"{http.request.uri.path}\",\"/index.html\",\"/index.php\"]}}]},{\"handle\":[{\"encodings\":{\"gzip\":{},\"zstd\":{}},\"handler\":\"encode\",\"prefer\":[\"zstd\",\"gzip\"]}]},{\"handle\":[{\"handler\":\"subroute\",\"routes\":[{\"handle\":[{\"handler\":\"rewrite\"}]},{\"handle\":[{\"handler\":\"reverse_proxy\",\"upstreams\":[{\"dial\":\"10.0.0.10:80\"}]}]}]}],\"match\":[{\"path\":[\"/*\"]}]}]}],\"terminal\":true},{\"match\":[{\"host\":[\"redacted-domain.com\"]}],\"handle\":[{\"handler\":\"subroute\",\"routes\":[{\"handle\":[{\"handler\":\"headers\",\"response\":{\"deferred\":true,\"delete\":[\"Server\"]}}]},{\"handle\":[{\"handler\":\"rewrite\",\"uri\":\"{http.matchers.file.relative}\"}],\"match\":[{\"file\":{\"try_files\":[\"{http.request.uri.path}\",\"/index.html\",\"/index.php\"]}}]},{\"handle\":[{\"encodings\":{\"gzip\":{},\"zstd\":{}},\"handler\":\"encode\",\"prefer\":[\"zstd\",\"gzip\"]}]},{\"handle\":[{\"handler\":\"subroute\",\"routes\":[{\"handle\":[{\"handler\":\"rewrite\"}]},{\"handle\":[{\"handler\":\"reverse_proxy\",\"upstreams\":[{\"dial\":\"10.0.0.11:80\"}]}]}]}],\"match\":[{\"path\":[\"/*\"]}]}]}],\"terminal\":true},{\"handle\":[{\"handler\":\"subroute\",\"routes\":[{\"handle\":[{\"handler\":\"static_response\",\"status_code\":503}]}]}],\"terminal\":true}]}}}}}"}
2025-01-21T22:25:58.014612981Z {"level":"info","ts":1737498358.0143294,"logger":"docker-proxy","msg":"Sending configuration to","server":"localhost"}
2025-01-21T22:25:58.016887427Z {"level":"info","ts":1737498358.015757,"logger":"admin.api","msg":"received request","method":"POST","host":"localhost:2019","uri":"/load","remote_ip":"127.0.0.1","remote_port":"55110","headers":{"Accept-Encoding":["gzip"],"Content-Length":["3871"],"Content-Type":["application/json"],"User-Agent":["Go-http-client/1.1"]}}
2025-01-21T22:25:58.018168110Z {"level":"info","ts":1737498358.0180442,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//localhost:2019","//[::1]:2019","//127.0.0.1:2019"]}
2025-01-21T22:25:58.018825301Z {"level":"info","ts":1737498358.0187433,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc00043a400"}
2025-01-21T22:25:58.019214888Z {"level":"info","ts":1737498358.019161,"logger":"http.auto_https","msg":"server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS","server_name":"srv0","https_port":443}
2025-01-21T22:25:58.019420087Z {"level":"info","ts":1737498358.019258,"logger":"http.auto_https","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
2025-01-21T22:25:58.019434255Z {"level":"warn","ts":1737498358.0193472,"logger":"http.auto_https","msg":"server is listening only on the HTTP port, so no automatic HTTPS will be applied to this server","server_name":"srv1","http_port":80}
2025-01-21T22:25:58.019970629Z {"level":"debug","ts":1737498358.019431,"logger":"http.auto_https","msg":"adjusted config","tls":{"automation":{"policies":[{}]}},"http":{"servers":{"srv0":{"listen":[":443"],"routes":[{"handle":[{"handler":"subroute","routes":[{"handle":[{"handler":"headers","response":{"deferred":true,"delete":["Server"]}}]},{"group":"group5","handle":[{"handler":"rewrite","uri":"{http.matchers.file.relative}"}],"match":[{"file":{"try_files":["{http.request.uri.path}","{http.request.uri.path}/"]}}]},{"group":"group5","handle":[{"handler":"rewrite","uri":"{http.matchers.file.relative}?{http.request.uri.query}"}],"match":[{"file":{"try_files":["/index.php"]}}]},{"handle":[{"encodings":{"gzip":{},"zstd":{}},"handler":"encode","prefer":["zstd","gzip"]}]},{"handle":[{"handler":"subroute","routes":[{"handle":[{"handler":"rewrite"}]},{"handle":[{"handler":"reverse_proxy","upstreams":[{"dial":"10.0.0.10:80"}]}]}]}],"match":[{"path":["/*"]}]}]}],"terminal":true},{"handle":[{"handler":"subroute","routes":[{"handle":[{"handler":"static_response","status_code":503}]}]}],"terminal":true}],"tls_connection_policies":[{}],"automatic_https":{}},"srv1":{"listen":[":80"],"routes":[{"handle":[{"handler":"subroute","routes":[{"handle":[{"handler":"headers","response":{"deferred":true,"delete":["Server"]}}]},{"handle":[{"handler":"rewrite","uri":"{http.matchers.file.relative}"}],"match":[{"file":{"try_files":["{http.request.uri.path}","/index.html","/index.php"]}}]},{"handle":[{"encodings":{"gzip":{},"zstd":{}},"handler":"encode","prefer":["zstd","gzip"]}]},{"handle":[{"handler":"subroute","routes":[{"handle":[{"handler":"rewrite"}]},{"handle":[{"handler":"reverse_proxy","upstreams":[{"dial":"10.0.1.3:80"}]}]}]}],"match":[{"path":["/*"]}]}]}],"terminal":true},{"handle":[{"handler":"subroute","routes":[{"handle":[{"handler":"headers","response":{"deferred":true,"delete":["Server"]}}]},{"handle":[{"handler":"rewrite","uri":"{http.matchers.file.relative}"}],"match":[{"file":{"try_files":["{http.request.uri.path}","/index.html","/index.php"]}}]},{"handle":[{"encodings":{"gzip":{},"zstd":{}},"handler":"encode","prefer":["zstd","gzip"]}]},{"handle":[{"handler":"subroute","routes":[{"handle":[{"handler":"rewrite"}]},{"handle":[{"handler":"reverse_proxy","upstreams":[{"dial":"10.0.0.11:80"}]}]}]}],"match":[{"path":["/*"]}]}]}],"terminal":true},{"handle":[{"handler":"subroute","routes":[{"handle":[{"handler":"headers","response":{"deferred":true,"delete":["Server"]}}]},{"handle":[{"handler":"rewrite","uri":"{http.matchers.file.relative}"}],"match":[{"file":{"try_files":["{http.request.uri.path}","/index.html","/index.php"]}}]},{"handle":[{"encodings":{"gzip":{},"zstd":{}},"handler":"encode","prefer":["zstd","gzip"]}]},{"handle":[{"handler":"subroute","routes":[{"handle":[{"handler":"rewrite"}]},{"handle":[{"handler":"reverse_proxy","upstreams":[{"dial":"10.0.0.10:80"}]}]}]}],"match":[{"path":["/*"]}]}]}],"terminal":true},{"handle":[{"handler":"subroute","routes":[{"handle":[{"handler":"headers","response":{"deferred":true,"delete":["Server"]}}]},{"handle":[{"handler":"rewrite","uri":"{http.matchers.file.relative}"}],"match":[{"file":{"try_files":["{http.request.uri.path}","/index.html","/index.php"]}}]},{"handle":[{"encodings":{"gzip":{},"zstd":{}},"handler":"encode","prefer":["zstd","gzip"]}]},{"handle":[{"handler":"subroute","routes":[{"handle":[{"handler":"rewrite"}]},{"handle":[{"handler":"reverse_proxy","upstreams":[{"dial":"10.0.0.11:80"}]}]}]}],"match":[{"path":["/*"]}]}]}],"terminal":true},{},{"handle":[{"handler":"subroute","routes":[{"handle":[{"handler":"static_response","status_code":503}]}]}],"terminal":true},{}],"automatic_https":{"disable":true}}}}}
2025-01-21T22:25:58.023131182Z {"level":"info","ts":1737498358.0230207,"logger":"http","msg":"enabling HTTP/3 listener","addr":":443"}
2025-01-21T22:25:58.023410048Z {"level":"info","ts":1737498358.0233397,"msg":"failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 2048 kiB, got: 416 kiB). See https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes for details."}
2025-01-21T22:25:58.023707922Z {"level":"debug","ts":1737498358.0236607,"logger":"http","msg":"starting server loop","address":"[::]:443","tls":true,"http3":true}
2025-01-21T22:25:58.023912639Z {"level":"info","ts":1737498358.0238526,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
2025-01-21T22:25:58.024309483Z {"level":"debug","ts":1737498358.0240366,"logger":"http","msg":"starting server loop","address":"[::]:80","tls":false,"http3":false}
2025-01-21T22:25:58.024431655Z {"level":"info","ts":1737498358.0243704,"logger":"http.log","msg":"server running","name":"srv1","protocols":["h1","h2","h3"]}
2025-01-21T22:25:58.024527861Z {"level":"info","ts":1737498358.0244524,"logger":"http","msg":"enabling automatic TLS certificate management","domains":["redacted-domain.com"]}
2025-01-21T22:25:58.025554402Z {"level":"debug","ts":1737498358.0251737,"logger":"tls","msg":"loading managed certificate","domain":"redacted-domain.com","expiration":1744321369,"issuer_key":"acme-v02.api.letsencrypt.org-directory","storage":"FileStorage:/data/caddy"}
2025-01-21T22:25:58.026480677Z {"level":"debug","ts":1737498358.026113,"logger":"tls.cache","msg":"added certificate to cache","subjects":["redacted-domain.com"],"expiration":1744321369,"managed":true,"issuer_key":"acme-v02.api.letsencrypt.org-directory","hash":"80add3e0373871a607ea1e09564361835d61332362840a87fa59f60833a6c165","cache_size":1,"cache_capacity":10000}
2025-01-21T22:25:58.026494717Z {"level":"debug","ts":1737498358.02615,"logger":"events","msg":"event","name":"cached_managed_cert","id":"53cde9fe-98a5-4b4c-8191-b3925d254f46","origin":"tls","data":{"sans":["redacted-domain.com"]}}
2025-01-21T22:25:58.026510483Z {"level":"info","ts":1737498358.0263295,"msg":"autosaved config (load with --resume flag)","file":"/config/caddy/autosave.json"}
2025-01-21T22:25:58.026514649Z {"level":"info","ts":1737498358.026339,"logger":"admin.api","msg":"load complete"}
2025-01-21T22:25:58.026877994Z {"level":"warn","ts":1737498358.0268214,"logger":"tls","msg":"storage cleaning happened too recently; skipping for now","storage":"FileStorage:/data/caddy","instance":"676fd37d-b459-43da-ba34-059fa60a4359","try_again":1737584758.0268192,"try_again_in":86399.999999531}
2025-01-21T22:25:58.027267212Z {"level":"info","ts":1737498358.0271208,"logger":"tls","msg":"finished cleaning storage units"}
2025-01-21T22:25:58.027472233Z {"level":"info","ts":1737498358.0274243,"logger":"docker-proxy","msg":"Successfully configured","server":"localhost"}
2025-01-21T22:25:58.036830536Z {"level":"info","ts":1737498358.0363965,"logger":"admin","msg":"stopped previous server","address":"localhost:2019"}
2025-01-21T22:25:58.948012919Z {"level":"info","ts":1737498358.9478965,"logger":"admin.api","msg":"received request","method":"POST","host":"localhost:2019","uri":"/load","remote_ip":"127.0.0.1","remote_port":"55120","headers":{"Accept-Encoding":["gzip"],"Content-Length":["3831"],"Content-Type":["application/json"],"Origin":["http://localhost:2019"],"User-Agent":["Go-http-client/1.1"]}}
2025-01-21T22:25:58.951021998Z {"level":"info","ts":1737498358.9508765,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//localhost:2019","//[::1]:2019","//127.0.0.1:2019"]}
2025-01-21T22:25:58.951815190Z {"level":"info","ts":1737498358.9517272,"logger":"http.auto_https","msg":"server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS","server_name":"srv0","https_port":443}
2025-01-21T22:25:58.951831872Z {"level":"info","ts":1737498358.9517517,"logger":"http.auto_https","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
2025-01-21T22:25:58.953524009Z {"level":"warn","ts":1737498358.9518855,"logger":"http.auto_https","msg":"server is listening only on the HTTP port, so no automatic HTTPS will be applied to this server","server_name":"srv1","http_port":80}
2025-01-21T22:25:58.953543861Z {"level":"debug","ts":1737498358.9519532,"logger":"http.auto_https","msg":"adjusted config","tls":{"automation":{"policies":[{}]}},"http":{"servers":{"srv0":{"listen":[":443"],"routes":[{"handle":[{"handler":"subroute","routes":[{"handle":[{"handler":"headers","response":{"deferred":true,"delete":["Server"]}}]},{"group":"group5","handle":[{"handler":"rewrite","uri":"{http.matchers.file.relative}"}],"match":[{"file":{"try_files":["{http.request.uri.path}","{http.request.uri.path}/"]}}]},{"group":"group5","handle":[{"handler":"rewrite","uri":"{http.matchers.file.relative}?{http.request.uri.query}"}],"match":[{"file":{"try_files":["/index.php"]}}]},{"handle":[{"encodings":{"gzip":{},"zstd":{}},"handler":"encode","prefer":["zstd","gzip"]}]},{"handle":[{"handler":"subroute","routes":[{"handle":[{"handler":"rewrite"}]},{"handle":[{"handler":"reverse_proxy","upstreams":[{"dial":"10.0.0.10:80"}]}]}]}],"match":[{"path":["/*"]}]}]}],"terminal":true},{"handle":[{"handler":"subroute","routes":[{"handle":[{"handler":"static_response","status_code":503}]}]}],"terminal":true}],"tls_connection_policies":[{}],"automatic_https":{}},"srv1":{"listen":[":80"],"routes":[{"handle":[{"handler":"subroute","routes":[{"handle":[{"handler":"headers","response":{"deferred":true,"delete":["Server"]}}]},{"handle":[{"handler":"rewrite","uri":"{http.matchers.file.relative}"}],"match":[{"file":{"try_files":["{http.request.uri.path}","/index.html","/index.php"]}}]},{"handle":[{"encodings":{"gzip":{},"zstd":{}},"handler":"encode","prefer":["zstd","gzip"]}]},{"handle":[{"handler":"subroute","routes":[{"handle":[{"handler":"rewrite"}]},{"handle":[{"handler":"reverse_proxy","upstreams":[{"dial":"10.0.1.3:80"}]}]}]}],"match":[{"path":["/*"]}]}]}],"terminal":true},{"handle":[{"handler":"subroute","routes":[{"handle":[{"handler":"headers","response":{"deferred":true,"delete":["Server"]}}]},{"handle":[{"handler":"rewrite","uri":"{http.matchers.file.relative}"}],"match":[{"file":{"try_files":["{http.request.uri.path}","/index.html","/index.php"]}}]},{"handle":[{"encodings":{"gzip":{},"zstd":{}},"handler":"encode","prefer":["zstd","gzip"]}]},{"handle":[{"handler":"subroute","routes":[{"handle":[{"handler":"rewrite"}]},{"handle":[{"handler":"reverse_proxy","upstreams":[{"dial":"10.0.0.11:80"}]}]}]}],"match":[{"path":["/*"]}]}]}],"terminal":true},{"handle":[{"handler":"subroute","routes":[{"handle":[{"handler":"headers","response":{"deferred":true,"delete":["Server"]}}]},{"handle":[{"handler":"rewrite","uri":"{http.matchers.file.relative}"}],"match":[{"file":{"try_files":["{http.request.uri.path}","/index.html","/index.php"]}}]},{"handle":[{"encodings":{"gzip":{},"zstd":{}},"handler":"encode","prefer":["zstd","gzip"]}]},{"handle":[{"handler":"subroute","routes":[{"handle":[{"handler":"rewrite"}]},{"handle":[{"handler":"reverse_proxy","upstreams":[{"dial":"10.0.0.10:80"}]}]}]}],"match":[{"path":["/*"]}]}]}],"terminal":true},{"handle":[{"handler":"subroute","routes":[{"handle":[{"handler":"headers","response":{"deferred":true,"delete":["Server"]}}]},{"handle":[{"handler":"rewrite","uri":"{http.matchers.file.relative}"}],"match":[{"file":{"try_files":["{http.request.uri.path}","/index.html","/index.php"]}}]},{"handle":[{"encodings":{"gzip":{},"zstd":{}},"handler":"encode","prefer":["zstd","gzip"]}]},{"handle":[{"handler":"subroute","routes":[{"handle":[{"handler":"rewrite"}]},{"handle":[{"handler":"reverse_proxy","upstreams":[{"dial":"10.0.0.11:80"}]}]}]}],"match":[{"path":["/*"]}]}]}],"terminal":true},{},{"handle":[{"handler":"subroute","routes":[{"handle":[{"handler":"static_response","status_code":503}]}]}],"terminal":true},{}],"automatic_https":{"disable":true}}}}}
2025-01-21T22:25:58.956325501Z {"level":"info","ts":1737498358.9561586,"logger":"http","msg":"enabling HTTP/3 listener","addr":":443"}
2025-01-21T22:25:58.956347752Z {"level":"debug","ts":1737498358.9562066,"logger":"http","msg":"starting server loop","address":"[::]:443","tls":true,"http3":true}
2025-01-21T22:25:58.956352287Z {"level":"info","ts":1737498358.9562151,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
2025-01-21T22:25:58.956548434Z {"level":"debug","ts":1737498358.9564493,"logger":"http","msg":"starting server loop","address":"[::]:80","tls":false,"http3":false}
2025-01-21T22:25:58.956556716Z {"level":"info","ts":1737498358.9565177,"logger":"http.log","msg":"server running","name":"srv1","protocols":["h1","h2","h3"]}
2025-01-21T22:25:58.956707881Z {"level":"info","ts":1737498358.95659,"logger":"http","msg":"enabling automatic TLS certificate management","domains":["redacted-domain.com"]}
2025-01-21T22:25:58.956715466Z {"level":"info","ts":1737498358.9566283,"logger":"http","msg":"servers shutting down with eternal grace period"}
2025-01-21T22:25:58.957076559Z {"level":"info","ts":1737498358.9570014,"msg":"autosaved config (load with --resume flag)","file":"/config/caddy/autosave.json"}
2025-01-21T22:25:58.957085700Z {"level":"info","ts":1737498358.9570184,"logger":"admin.api","msg":"load complete"}
2025-01-21T22:25:58.960942306Z {"level":"info","ts":1737498358.9604564,"logger":"admin","msg":"stopped previous server","address":"localhost:2019"}
2025-01-21T22:25:59.389405518Z {"level":"info","ts":1737498359.3876777,"logger":"admin.api","msg":"received request","method":"POST","host":"localhost:2019","uri":"/load","remote_ip":"127.0.0.1","remote_port":"55124","headers":{"Accept-Encoding":["gzip"],"Content-Length":["3831"],"Content-Type":["application/json"],"Origin":["http://localhost:2019"],"User-Agent":["Go-http-client/1.1"]}}
2025-01-21T22:25:59.390499987Z {"level":"info","ts":1737498359.3902457,"msg":"config is unchanged"}
2025-01-21T22:25:59.390519414Z {"level":"info","ts":1737498359.390359,"logger":"admin.api","msg":"load complete"}
2025-01-21T22:26:02.920349962Z {"level":"debug","ts":1737498362.916536,"logger":"docker-proxy","msg":"Skipping swarm config caddyfiles because swarm is not available"}
2025-01-21T22:26:02.955545776Z {"level":"debug","ts":1737498362.9551296,"logger":"docker-proxy","msg":"Skipping swarm services because swarm is not available"}
2025-01-21T22:26:07.917433219Z {"level":"debug","ts":1737498367.9171517,"logger":"docker-proxy","msg":"Skipping swarm config caddyfiles because swarm is not available"}
2025-01-21T22:26:07.932788523Z {"level":"debug","ts":1737498367.931759,"logger":"docker-proxy","msg":"Skipping swarm services because swarm is not available"}
2025-01-21T22:26:12.917448075Z {"level":"debug","ts":1737498372.9172616,"logger":"docker-proxy","msg":"Skipping swarm config caddyfiles because swarm is not available"}
2025-01-21T22:26:12.934940759Z {"level":"debug","ts":1737498372.9348059,"logger":"docker-proxy","msg":"Skipping swarm services because swarm is not available"}
2025-01-21T22:26:17.917630742Z {"level":"debug","ts":1737498377.9174252,"logger":"docker-proxy","msg":"Skipping swarm config caddyfiles because swarm is not available"}
2025-01-21T22:26:17.929623360Z {"level":"debug","ts":1737498377.9277442,"logger":"docker-proxy","msg":"Skipping swarm services because swarm is not available"}
2025-01-21T22:26:22.917878731Z {"level":"debug","ts":1737498382.917685,"logger":"docker-proxy","msg":"Skipping swarm config caddyfiles because swarm is not available"}
2025-01-21T22:26:22.927318216Z {"level":"debug","ts":1737498382.927074,"logger":"docker-proxy","msg":"Skipping swarm services because swarm is not available"}
2025-01-21T22:26:27.918570132Z {"level":"debug","ts":1737498387.918422,"logger":"docker-proxy","msg":"Skipping swarm config caddyfiles because swarm is not available"}
2025-01-21T22:26:27.925379194Z {"level":"debug","ts":1737498387.9248548,"logger":"docker-proxy","msg":"Skipping swarm services because swarm is not available"}
2025-01-21T22:26:32.918875658Z {"level":"debug","ts":1737498392.9187307,"logger":"docker-proxy","msg":"Skipping swarm config caddyfiles because swarm is not available"}
2025-01-21T22:26:32.939426182Z {"level":"debug","ts":1737498392.9373004,"logger":"docker-proxy","msg":"Skipping swarm services because swarm is not available"}

The domain name is redacted because I don’t want the general public knowing what infrastructure we use. But the problem should be clear from my first message without the domain name.

Hmm, that looks a lot like Caddy Docker Proxy config.

How did you get to your current configuration?

Have you tried simplifying to the minimum possible configuration? e.g.

caddy_1=https://my-redacted-website.com
caddy_1.1_reverse_proxy={{upstreams 80}}