Skip to content
gohacks.dev
DevOps

Caddyfile Generator

Generate a Caddyfile for a PHP-FPM app such as Laravel, a reverse proxy to Node, Go or Python, or a static single-page app, with automatic HTTPS.

Free · No sign-up · Your inputs stay in your browser

Input

Generate a Caddyfile

Output

Caddyfile

452 characters

Caddy obtains and renews the TLS certificate itself and redirects HTTP to HTTPS without being told, as long as ports 80 and 443 reach it and DNS points at the server. php_fastcgi already does the try_files dance a Laravel front controller needs. Validate with caddy validate, apply with caddy reload.

Runs in this browser. Nothing you paste is sent to a server.

HTTPS without configuration

Caddy obtains and renews certificates from Let's Encrypt or ZeroSSL on its own and redirects HTTP to HTTPS, as long as DNS points at the server and ports 80 and 443 reach it. There is no certbot cron to forget. The automatic HTTPS documentation explains the conditions.

php_fastcgi does the routing

The php_fastcgi directive already includes the try_files logic a front controller needs, so Laravel, Symfony and WordPress work without rewrite rules. Validate with caddy validate --config Caddyfile and apply with caddy reload, which swaps the config without dropping connections.

Share

Frequently asked questions

Can Caddy replace Nginx in front of PHP-FPM?
Yes. php_fastcgi talks to PHP-FPM over a socket or TCP like Nginx's fastcgi_pass. For most sites the performance difference does not matter; the shorter config and automatic certificates do.
How do I serve a site without HTTPS in Caddy?
Write the address with http://, as in http://example.local, or use a port. Caddy only manages certificates for site addresses that are public domain names.
Is what I paste sent anywhere?
No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is sent to our server or stored.

Keep planning

Similar tools