Custom Caddy directives in serversideup/php FrankenPHP image – how to properly extend security headers and caddyfile.d? #680
Unanswered
beliven-alex-zongaro
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm using the
serversideup/phpFrankenPHP Docker image and trying to understand the correct way to extend Caddy configuration in a safe and supported way.Context
The image already provides:
/etc/frankenphp/Caddyfilecaddyfile.d/*.caddyfileimport mechanismsecuritysnippet with predefined headersCADDY_SERVER_EXTRA_DIRECTIVESinjected into thephp-app-commonblockWhat I'm trying to achieve
I need to add custom HTTP headers (for example CSP, Permissions-Policy, and some additional security headers) and ideally:
securityblockWhat I've tried so far
Using
caddyfile.d/*.caddyfile:securityblockUsing
CADDY_SERVER_EXTRA_DIRECTIVES:header { ... }overridesTrying to extend the existing
securitysnippet:headerblocks do not mergesecuritybreaks or overrides existing behaviorMain issue
It is not clear what the intended extension mechanism is for:
securityconfigurationcaddyfile.dRight now it feels like there is:
caddyfile.d)CADDY_SERVER_EXTRA_DIRECTIVES)Questions
securityheaders without editing the base image?caddyfile.dintended only for standalone site/server directives, or can it safely extend existing snippets?CADDY_SERVER_EXTRA_DIRECTIVESthe only intended extension point for runtime customization?Goal
I’m trying to understand the intended architecture so I can:
Thanks in advance 👍
Beta Was this translation helpful? Give feedback.
All reactions