You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to surcharge a caddyfile for secure header ? #621
@kilwir76 if you're using vanilla FrankenPHP, you can just put a Caddyfile in the root directory of your project, then run frankenphp run. If you're using Laravel Octane, you can use the --caddyfile flag of the octane:start command.
In the Caddyfile, you can use the header directive to change the response headers.
@withinboredom "surcharger" means "to override" in French 😅
Activity
withinboredom commentedon Mar 1, 2024
I think you used an incorrect word: "surcharge" has to do with money, and you are asking how to get money from a caddyfile for headers.
dunglas commentedon Mar 1, 2024
@kilwir76 if you're using vanilla FrankenPHP, you can just put a Caddyfile in the root directory of your project, then run
frankenphp run. If you're using Laravel Octane, you can use the--caddyfileflag of theoctane:startcommand.In the
Caddyfile, you can use theheaderdirective to change the response headers.@withinboredom "surcharger" means "to override" in French 😅
withinboredom commentedon Mar 2, 2024
Oh, hahaha, that's awesome and thanks for the heads up!
kilwir76 commentedon Mar 2, 2024
Sorry for my disastrous English ^^, so I create my Caddyfile at the root of my project and I override the one in /etc/caddy/?
If so can I take the basic one in /etc/caddy?
If not, what more should I do?
Knowing that my application is a symfony application under the dockerfile present on your site
dunglas commentedon Mar 2, 2024
Yes you can adapt the modify or replace the
Caddyfilethat is in/etc/caddy. If you're using Docker that's probably the easiest way.kilwir76 commentedon Mar 2, 2024
Yes of course , so i can copy the existing caddyfile on /etc/caddy and the adapter for my needs
static: build with PHP 8.6 (#2861)