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

Cloudflare no longer support mod_cloudflare. Need to switch to mod_remoteip? #115

Open
deggertsen opened this issue Apr 15, 2020 · 3 comments

Comments

@deggertsen
Copy link

What type of report is this:
Bug report

Description:

Getting this today in Elastic Beanstalk. It seems the perhaps Cloudflare has removed support for this mod and you can't download that file from their site anymore.

Application deployment failed at 2020-04-15T17:04:02Z with exit status 8 and error: command 20_cloudflare in .ebextensions/20_cloudflare.config failed.

--2020-04-15 17:00:57-- https://www.cloudflare.com/static/misc/mod_cloudflare/mod_cloudflare.c
Resolving www.cloudflare.com (www.cloudflare.com)... 104.17.210.9, ...
Connecting to www.cloudflare.com (www.cloudflare.com)|104.17.210.9|:443... connected.
HTTP request sent, awaiting response... 522
2020-04-15 17:04:02 ERROR 522: (no description).

You can see that mod_cloudflare.c has been deprecated here:
https://support.cloudflare.com/hc/en-us/articles/200170786-Restoring-original-visitor-IPs-Logging-visitor-IP-addresses-with-mod-cloudflare-
and here:
https://github.com/cloudflare/mod_cloudflare

Looks like we need to switch over to mod_remoteip.

I would love some direction on how we might go about doing that.

@heathdutton
Copy link
Member

Hmm, thanks for the report, I did not know about this deprecation. Been using mod_cloudflare for so many years now.

Here's the only place that needs changing: https://github.com/TheDMSGroup/mautic-eb/blob/dev/.ebextensions/20_cloudflare.config

Would love a PR on this if you have time to contribute!

@deggertsen
Copy link
Author

deggertsen commented Apr 15, 2020

Yeah, I'll see what I can do. Unfortunately I don't fully understand how this works so it might be awhile before I can figure it out.

If you could give me any direction on how mod_cloudflare is being used that might help give me a jump start.

@deggertsen
Copy link
Author

It looks like CloudFlare put the file back up at https://www.cloudflare.com/static/misc/mod_cloudflare/mod_cloudflare.c
But we probably should work towards moving to mod_remoteip anyways.

It looks like this is what needs to be done:

  1. Enable mod_remoteip (a2enmod remoteip)
  2. Add "RemoteIPHeader CF-Connecting-IP" to the Apache config inside the VirtualHost
  3. Update combined LogFormat entry in apache.conf, replacing %h with %a
  4. Define trusted proxy addresses as show here

I know how to do all of that on a standard server, but in the EB config files I have no idea...

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

No branches or pull requests

2 participants