-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCaddyfile
More file actions
65 lines (54 loc) · 2.03 KB
/
Copy pathCaddyfile
File metadata and controls
65 lines (54 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{
# Disable the Caddy admin API and HTTPS — not needed in the devcontainer
admin off
auto_https off
}
:8000 {
# Resolve paths relative to the Symfony public/ document root
root * public
# Compress responses with zstd (preferred) or gzip
encode zstd gzip
# Inside GitHub Codespaces all traffic arrives via the TLS-terminating
# port-forwarding proxy — force the forwarded scheme so Symfony generates
# https URLs. {env.CODESPACE_NAME} is empty outside Codespaces.
@is_codespace expression `{env.CODESPACE_NAME} != ""`
request_header @is_codespace X-Forwarded-Proto "https"
# Serve existing static files (CSS, JS, images, fonts) directly —
# requests that match a real file on disk never reach PHP-FPM
file_server
# Forward everything else to PHP-FPM via the Unix socket configured in
# .devcontainer/config/php-fpm/www.conf (lower latency than TCP)
php_fastcgi unix//tmp/php-fpm.sock {
# Pass the real client IP to Symfony's trusted_proxies / Request::getClientIp()
trusted_proxies private_ranges
# Symfony's entry point; php_fastcgi handles try_files automatically
index index.php
env APP_ENV {$APP_ENV:dev}
env APP_DEBUG {$APP_DEBUG:1}
}
# ── FPM health endpoints ──────────────────────────────────────────────────
# Exposed by .devcontainer/config/php-fpm/www.conf (pm.status_path / ping.path)
# Useful for liveness probes and health checks
handle /fpm-ping {
reverse_proxy unix//tmp/php-fpm.sock {
transport fastcgi {
split /
}
}
}
handle /fpm-status {
reverse_proxy unix//tmp/php-fpm.sock {
transport fastcgi {
split /
}
}
}
# ── Logging ───────────────────────────────────────────────────────────────
# Write to stderr so `mise dev` surfaces it in the terminal alongside
# FPM and worker output
log {
output stderr
format console
level INFO
}
}