True user IPs when using Cloudflare

I had a legitimate user message me directly saying that they could not sign up up because “New registrations are not allowed from your IP address”

After some investigation I found the relevant setting and bumped it up to 9999. But then I wanted to investigate further, so looked up the users reg IP after they signed up:

The other threads about this setting seem to indicate that repeat reg IPs should not be common, that the low default of 3 is reasonable. So does this situation with multiple reg ids coming from Cloudflare point to some misconfiguration I need to look in to? This instance is running on Digital Ocean, and there is just an A record on CloudFlare pointing at it.

As an aside I would strongly suggest admins be notified when users are turned away for this reason. I would never have known about or been able to help them sign up except that they emailied me directly.

2 Likes

Cloudflare acts as a proxy between your users and your server, which means the default configuration will show Cloudflare nodes rather than origin IPs.

You need to add the Cloudflare template to your app.yml so that you can see the true originating IP of your users.

Under templates: add:

- "templates/cloudflare.template.yml"

Then rebuild.

8 Likes

Brilliant, thank you!

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.