winzik/tools/embed/examples/Caddyfile
David Nurdin 87ad5126aa Embed kit and docs: a playground application on a partner's site without iframe nor CORS, and custom domains
tools/embed/jumphp-embed.php: one PHP file (7.4+, curl) that signs the requests to the
playground's /api/embed/<slug>/ (HMAC-SHA256 over method, path, query, time and body
hash), serves the application under the partner's base path (streamed, Range, gzip
passed through, immutable files kept on disk), relays the TCP tickets with the
visitor's address, and gives the blocks (disk cache, ETag revalidation, last copy when
the playground is down); no cookie either way, security headers. Its end-to-end test
(tools/embed/tests/test.sh, Docker), the WordPress plugin (shortcode
[jumphp_block app block], the base path answered at plugins_loaded, settings page,
secret possibly in wp-config.php), nginx / Caddy / plain PHP examples.

docs/embed.md (+ .en), docs/domains.md (+ .en), AGENTS.md section 14.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-14 02:41:11 +01:00

14 lines
506 B
Caddyfile

# Caddy in front of a site: /chat/ answered by the JumPHP embed kit (tools/embed/jumphp-embed.php, docs/embed.md) through PHP-FPM.
# The settings come from the environment of PHP-FPM (JUMPHP_EMBED_SERVER, _APP, _SITE, _SECRET, _BASE, _CACHE): clear_env = no in its pool.
example.com {
redir /chat /chat/ 301
handle /chat/* {
root * /srv/jumphp-embed
rewrite * /jumphp-embed.php
php_fastcgi unix//run/php/php-fpm.sock {
flush_interval -1
read_timeout 300s
}
}
# ... the rest of the site
}