WordPress.org

Ready to get started?Download WordPress

Forums

StatComm (StatPress Community) Multisite Edition
[resolved] Correct IP address behind reverse proxy (6 posts)

  1. rogst
    Member
    Posted 1 year ago #

    Hi

    I have my wordpress site behind a reverse proxy, this sets REMOTE_ADDR to 127.0.0.1. To get the client IP the plugin needs to get the address from HTTP_X_FORWARDED_FOR.

    I changed line 958 in statcomm.php to:
    $ipAddress = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];

    Thanks to an awesome plugin

    http://wordpress.org/extend/plugins/statpress-community-formerly-statcomm/

  2. WPReady
    Member
    Plugin Author

    Posted 1 year ago #

    Excellent tip!
    We'll add to the next release.

    Thanks for your feedback!

  3. neysachen
    Member
    Posted 1 year ago #

    I still get the 127.0.0.1 display even with this modify. How can I fix it?

    Thanks.

  4. rogst
    Member
    Posted 1 year ago #

    Hi Neysachen

    You need to make sure your reverse proxy is sending the http header X_FORWARDED_FOR along the request which contains the real client IP.

  5. neysachen
    Member
    Posted 1 year ago #

    Thank you for your reply, but sorry i can not understand what do you mean.

  6. WPReady
    Member
    Plugin Author

    Posted 1 year ago #

    Current version 1.7.60 adress the problem thanks rogst suggestion.
    Rogst you will be mentioned on the contributor list.
    Thank you.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic