• theturtle

    (@theturtle)


    my site is a NAT environment

    It was :
    web browser -> IP sharing device (port forwarding) -> NAS (192.168.1.x) hosting wordpress site

    WP Statistics works perfectly.

    Now I changed the environment to

    web browser -> IP sharing device (port forwarding) -> NAS (192.168.1.x) hosting docker (172.17.0.1) -> wordpress container/site (172.17.0.4)

    WP Statistics works, but all the incoming IP address are 172.17.0.1

    Any idea for this situation ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mostafa Soufi

    (@mostafas1990)

    Please create a file on your server and put below code to see the IP:

    <?php print_r($_SERVER); ?>

    Let me know about the result of your test.

    In the current form (12.3.6) WP-Statistics will only use $_SERVER[‘REMOTE_ADDR’] as source for visitor IP addresses (“includes/classes/class-wp-statistics.php:845ff). When running behind some types of load balancers, CDNs, Proxys – or in your case docker – this might only point to the previous server instead of the visitor. Most of these systems will send an additional header like “X-Forwarded-For” or “X-Real-IP” containing the originating system. Adding support for these headers is just 4 additional lines and would allow to use WP-Statistic even in these situations.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘wordpress in docker’ is closed to new replies.