I’m using Caddy and php-fpm with Docker compose. The issue is the request is not even being sent to the php-fpm container.
Caddyfile
{
debug
}
app.domain {
root * /srv/laravel/public
encode zstd gzip
php_fastcgi wep-app:9000 {
root /var/www/html/public
}
file_server
log {
output file /var/log/caddy/app.log
}
}
docker-compolse.yaml
services:
web-app:
image: ghcr.io/my-image/web-app
restart: unless-stopped
mem_limit: 8G
volumes:
- laravel_public_volume:/var/www/html/public
caddy:
build:
dockerfile: ./dockerfiles/caddy/Dockerfile
restart: unless-stopped
env_file:
- './envs/caddy/production.env'
ports:
- "80:80"
- "443:443"
- "443:443/udp"
volumes:
- ./configs/caddy/Caddyfile-production:/etc/caddy/Caddyfile
- ./caddy/data:/data
- laravel_public_volume:/srv/laravel/public
volumes:
laravel_public_volume:
Caddy error log
{
"level": "debug",
"ts": 1708679860.2886791,
"logger": "http.handlers.reverse_proxy",
"msg": "upstream roundtrip",
"upstream": "wep-app:9000",
"duration": 0.002582091,
"request": {
"remote_ip": "xx",
"remote_port": "64560",
"client_ip": "xx",
"proto": "HTTP/2.0",
"method": "GET",
"host": "app.domain",
"uri": "/index.php",
"tls": {
"resumed": false,
"version": 772,
"cipher_suite": 4865,
"proto": "h2",
"server_name": "app.domain"
}
},
"error": "dialing backend: dial tcp: lookup wep-app on 127.0.0.11:53: server misbehaving"
}