Skip to content

Add caddyfile-snippets.d for custom snippets - #732

Open
beholdr wants to merge 1 commit into
serversideup:mainfrom
beholdr:feat-custom-snippets
Open

beholdr wants to merge 1 commit into
serversideup:mainfrom
beholdr:feat-custom-snippets

Conversation

@beholdr

@beholdr beholdr commented Oct 24, 2026

Copy link
Copy Markdown

Hi! I think it would be great to add support for Caddy custom snippets. We discussed something similar in #680

The problem is that currently, we only have three places to import our configuration files: caddyfile-global.d, caddyfile-server.d, or caddyfile.d. However, none of these places allow for the creation of custom snippets. Snippets should be declared at the top level of the Caddyfile and before any common snippets like, php-app-common.

This PR adds the import of the configuration files from the caddyfile-snippets.d directory at the top of the Caddyfile. This allows us to use any of the snippets defined in that files anywhere we need them.

What do you think? This would allow us to extend our server rules in a modular format without having to override the default configuration.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant