Support » Plugin: Wordfence Security - Firewall & Malware Scan » Get IP’s with both nginx AND CloudFlare

  • Moderator Bet Hannon

    (@bethannon1)


    Support Team Volunteer Coordinator

    We’ve recently made a change and added nginx to our server AND put sites on CloudFlare.

    I intially changed “How does Wordfence get IPs” to CloudFlare, thinking that the sites would be coming from there first.

    This gives me a “Your ‘How does Wordfence get IPs’ setting is misconfigured.” error however.

    So I tried the X-headers setting for use with front-end proxies, but those ALSO giv eme the misconfigured error.

    In this situation, what is the correct setting for “How does Wordfence get IPs”?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @bethannon1,

    Under Wordfence -> Tools -> Diagnostics -> IP Detection, can you tell me the values for all the rows?

    For example: https://i.imgur.com/zCxODz8.png

    Also do you have any trusted proxies set?

    Dave

    Moderator Bet Hannon

    (@bethannon1)

    Support Team Volunteer Coordinator

    Hi Dave!

    Here’s a screenshot of what I see: https://i.imgur.com/NdYOt98.png

    REMOTE_ADDR is showing the server’s IP. The X optoins are showing my IP as the user.

    No trusted proxies. I wasn’t clear from the documenation whether that was needed.

    Moderator Bet Hannon

    (@bethannon1)

    Support Team Volunteer Coordinator

    So I want to choose the option that correctly shows my user IP address? Right?

    Hi again!

    I would go into Wordfence -> All Options -> General Options, and un-tick Scan for misconfigured How does Wordfence get IPs.

    For example: https://i.imgur.com/q9BVzSq.png

    You can then select X-Real-IP or X-Forwarded-For (both have the same values) for your IP retrieval method.

    I skimmed over the code responsible for applying the warning for a misconfigured IP setting – and it seems to use your WordPress connection to send a request to Wordfence servers. Wordfence then replies back with your server’s IP, and it’s checked with all the available options to see which one matches.

    I think in your server’s situation, the outbound IP address that your server uses is not the same IP address for inbound connections.

    Dave

    Moderator Bet Hannon

    (@bethannon1)

    Support Team Volunteer Coordinator

    Thanks!

    We got this sorted!

    For anyone who comes along later: on the “How does Wordfence get IPs” settings, choose the option that acurately shows your own user IP address. 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Get IP’s with both nginx AND CloudFlare’ is closed to new replies.