Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework Caddyfile #255

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Rework Caddyfile #255

wants to merge 4 commits into from

Conversation

inetol
Copy link
Contributor

@inetol inetol commented Aug 6, 2024

This PR completely reworks the Caddy config file to solve several inconveniences that are not worth having them in separate PRs, the changes are these...

  • Try to protect the user data (query searches, IPs and headers) logged on Caddy if there is an error with the upstream response (or Caddy itself).
  • Overwrite the Cache-Control and Content-Security-Policy headers if its matcher token matches rather than doing the comparison twice in a row.
  • Prefer to set the ENV defaults directly in the Caddyfile.
  • Modified the Strict-Transport-Security header to not include all subdomains in the HSTS policy nor mark the latter to enter the HSTS preload list.
  • Modified the Permissions-Policy header to remove useless features.
  • Remove the encode directive, otherwise Caddy will not passthrough the precompressed files served by uWSGI.
  • Remove the X-XSS-Protection and Feature-Policy headers following the standards recommendations and evaluating the possible impact with older clients.
  • Other minor structure and format changes.

All changes have been tested and validated without requiring major changes for users.

Since this header is attached to each outgoing request the overall size is slightly increased by 300 bytes, we don't care if the site is allowed to play media in the background, so with the vast majority of features that have been added (and those that were already present)
Caddyserver actually did passthrough the precompressed resources served by uWSGI (Oops)
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