docs: Add Caddy web server configuration (revives #9199)#14659
Open
docs: Add Caddy web server configuration (revives #9199)#14659
Conversation
Agent-Logs-Url: https://github.com/nextcloud/documentation/sessions/9a2e3f3e-0221-4549-a579-40470c763467 Co-authored-by: nextcloud-command <88102737+nextcloud-command@users.noreply.github.com>
Agent-Logs-Url: https://github.com/nextcloud/documentation/sessions/9a2e3f3e-0221-4549-a579-40470c763467 Co-authored-by: nextcloud-command <88102737+nextcloud-command@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Revive and improve Caddyfile configuration for Nextcloud
docs: Add Caddy web server configuration (revives #9199)
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Revives and fixes PR #9199, adding a complete Caddy 2.6+ + PHP-FPM configuration sample and documentation page for Nextcloud.
New files
Caddyfile.sample— complete working config covering compression, security headers,.well-knownrouting, asset caching, internal path blocking, and PHP-FPM passthroughcaddy.rst— documentation page modelled afternginx.rstFixes applied from original PR review
/corn.php/cron.php:language: caddy(unknown Pygments lexer, build warning):language: nginxhandle_path+vars/env REQUEST_URIworkaround and note onOVERWRITEWEBROOTinconfig.php@assetsheader path-scoping syntaxCache-Controlvalue with a comment for.woff2overrideAdditions
php_serveras an alternative that eliminates manual rewrite rules; links togreyxor/nextcloud-dockeras a reference implementationcaddyadded toinstallation/index.rsttoctree afternginx☑️ Resolves
🖼️ Screenshots
✅ Checklist
codespellor similar and addressed any spelling issuesOriginal prompt
Background
This is a revival and improvement of PR #9199 (#9199), which adds a Caddy web server configuration sample for Nextcloud. That PR has been open since 2022 and has received 2 approvals (from @CarlSchwan and @ChristophWurst) but stalled due to a few fixable issues.
The configuration should also be inspired by the real-world Caddyfile used in the
nextcloud-dockerproject by @GreyXor: https://gitlab.com/greyxor/nextcloud-docker/-/raw/main/rootfs/etc/frankenphp/Caddyfile?ref_type=headsFiles to create/modify
1.
admin_manual/installation/Caddyfile.sample(new file)Create this file with a complete, working Caddy + PHP-FPM configuration for Nextcloud. Start from the original PR's content and apply all of the following fixes and improvements:
Critical fixes:
/corn.phpwhich must be/cron.phpContent of the file (use this as the basis, improve as needed):