1
0

Caddyfile 874 B

123456789101112131415161718192021222324252627282930313233
  1. # FrankenPHP Caddyfile for the api container.
  2. # Serves Slim from public/ on :8081.
  3. {
  4. frankenphp
  5. order php_server before file_server
  6. auto_https off
  7. admin off
  8. }
  9. :8081 {
  10. root * /app/public
  11. encode zstd gzip
  12. # Internal jobs API: only callable from loopback / RFC1918.
  13. # The PHP layer also enforces this (InternalNetworkMiddleware) — Caddy
  14. # is the first line of defence for production deployments where the
  15. # api is reachable from the public internet.
  16. @internal {
  17. path /internal/*
  18. remote_ip 127.0.0.1/32 ::1/128 172.16.0.0/12 10.0.0.0/8 192.168.0.0/16
  19. }
  20. handle @internal {
  21. php_server
  22. }
  23. @external_internal_blocked {
  24. path /internal/*
  25. not remote_ip 127.0.0.1/32 ::1/128 172.16.0.0/12 10.0.0.0/8 192.168.0.0/16
  26. }
  27. respond @external_internal_blocked 404
  28. php_server
  29. }