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

config for caddy version >= 2.5 changed #177

Open
inos-github opened this issue Jul 8, 2022 · 1 comment
Open

config for caddy version >= 2.5 changed #177

inos-github opened this issue Jul 8, 2022 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@inos-github
Copy link

after upgrading caddy to version 2.5, notify_push was broken. After some researches I found this bug report and the solution for the problem.

the root cause for the changed configuration is:

caddy v2.5.0 no longer blindly trusts X-Forwarded-For headers from any client.

The release notes under Notable state:

Reverse proxy: Incoming X-Forwarded-* headers will no longer be automatically trusted, to prevent spoofing. Now, trusted_proxies must be configured to specify a list of downstream proxies which are trusted to have sent good values. You only need to configure trusted proxies if Caddy is not the first server being connected to. For example, if you have Cloudflare in front of Caddy, then you should configure this with Cloudflare’s list of IP ranges 1.

to fix it, change your caddy-file to somthing like this:

php_fastcgi unix//run/php-fpm/nextcloud.sock {
    env modHeadersAvailable true
    env front_controller_active true
    env HTTPS on
+   trusted_proxies private_ranges
}

It would make sense to change the README accordingly...

@RedrootDEV
Copy link

I have a problem related to this, until Caddy 2.4.6 Nextcloud did not show me proxy errors, from version 2.5.0 it started to happen.
Even adding the full list of cloudflare IP's as "trusted_proxies" the error remains.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants