Passing original incoming IP through Cloudflare to NPM? #5597
Unanswered
jacksaturn
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.
-
I'm self-hosting a Mastodon server behind Cloudflare and trying to configure NPM so that I can pass a visitor's original (non-Cloudflare) IP address through to Mastodon.
All my other domains are configured in NPM using an Access List set up to only accept Cloudflare IP addresses. That works great for all of those sites, but in the interest of properly federating my Mastodon instance, I need to be able to see the actual IP addresses coming in.
Currently I have the Cloudflare Access List disabled, with Access set to "Public."
In the Custom Nginx Configuration field of the Proxy Host I have the following code:
That list of IPs are all the possible Cloudflare IPs. The
CF-Connecting-IPis the original visitor IP address, prior to Cloudflare.This setup is working, and Mastodon logs the correct external IP addresses, but unfortunately this setup still leaves the Access List as "Public" rather than narrowed down specifically to my pre-existing Cloudflare list.
If I turn the Cloudflare Access List back on, I get a 403 Forbidden error from Openresty in the browser unless I also delete the
real_ip_header CF-Connecting-IP;line.Any ideas about what I can change in my configuration in order to be able to use the Access List within NPM while still receiving the real external IP addresses of visitors?
Beta Was this translation helpful? Give feedback.
All reactions