Skip to content

How to surcharge a caddyfile for secure header ? #621

Closed

Description

@kilwir76

Describe you feature request

I want to surchage a caddyfile for securing headers.

How do i do that ?

Best regards

Activity

  1. added
    enhancement
    on Mar 1, 2024
  2. withinboredom commented on Mar 1, 2024

    @withinboredom
    Member

    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.

  3. dunglas commented on Mar 1, 2024

    @dunglas
    Member

    @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 😅

  4. withinboredom commented on Mar 2, 2024

    @withinboredom
    Member

    "surcharger" means "to override" in French 😅

    Oh, hahaha, that's awesome and thanks for the heads up!

  5. kilwir76 commented on Mar 2, 2024

    @kilwir76
    Author

    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

  6. dunglas commented on Mar 2, 2024

    @dunglas
    Member

    Yes you can adapt the modify or replace the Caddyfile that is in /etc/caddy. If you're using Docker that's probably the easiest way.

  7. kilwir76 commented on Mar 2, 2024

    @kilwir76
    Author

    Yes of course , so i can copy the existing caddyfile on /etc/caddy and the adapter for my needs

  8. added a commit that references this issue on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions