Answered: How to show the real user IP address in q2a using cloudfare?

Post date: 2020-09-27 05:07:13
Views: 99

The Cloudflare plugin overrides the builtin function qa_remote_ip_address() to check if the incoming request sent an additional header HTTP_CF_CONNECTING_IP with the real client IP address. Otherwise it falls back to the builtin function which returns either the client address the server sees (REMOTE_ADDR) or null.

Check an incoming request (i.e. check the content of the PHP variable $_SERVER for that request) to see if that header HTTP_CF_CONNECTING_IP was set to 0.0.0.0 or is missing entirely, and also what value REMOTE_ADDR has. Maybe add some logging that logs the values $_SERVER'REMOTE_ADDR'] and $_SERVER'HTTP_CF_CONNECTING_IP'] with a timestamp for each request.

Either way, I'd suspect that the problem is not with Q2A but with Cloudflare (do you need to configure something on the Cloudflare side for them to send the header with the real client IP?), or with something manipulating traffic between the Cloudflare proxy and your Q2A server.

Not much else I can tell you without more information.

Please click Here to read the full story.
 
Other Top and Latest Questions:
Movie: Spy x Family Code: White
Oil edges higher as U.S. weighs added sanctions on Iran oil exports after attack on Israel
How to manage your money in your 40s, according to CFPs: As your investments grow, 'mistakes can get bigger' too
Meaningful birthday gift for 10yo (first of series) ?
If this is a stock market correction, here's how history says it will unfold
Potential Trump trial jurors dismissed because of bias against former president
Justices question obstruction charge in Jan 6 rioter prosecution, which could affect Trump's case
Healthy Returns: U.S. drug shortages reach record high, hitting Wegovy, ADHD medications
Why a $100,000 income no longer buys the American Dream in most places
IMF upgrades global growth forecast as economy proves 'surprisingly resilient' despite downside risks