Caddy¶
When Fujin deploys your application, it installs and configures Caddy as a reverse proxy. You may want to use this same Caddy instance for other applications not managed by Fujin.
Using Caddy with Custom Applications¶
Fujin configures Caddy through its API rather than the Caddyfile. If you edit the Caddyfile directly and reload, you’ll overwrite Fujin’s configuration.
The solution is to use a script that preserves Fujin configurations while adding your own. We’ve created a Python script that:
Gets the current Caddy configuration via the API
Preserves all Fujin-managed routes
Converts your Caddyfile to JSON
Merges your routes with Fujin’s routes
Applies the combined configuration back to Caddy
You can download the script here: apply-caddy-config.py
Run it with this one-liner:
curl -L -s https://fujin.falcoproject.com/caddy-script | python3 - /path/to/your/Caddyfile
Example Caddyfile:
myapp.example.com {
root * /var/www/myapp
file_server
}
This script preserves Fujin configurations while adding your custom routes.