Announcement

Collapse
No announcement yet.

IP of client when EspoCrm is behind a proxy

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • IP of client when EspoCrm is behind a proxy

    Hello Yuri,

    i have try all (with my skill).. but with no result.. i can't have client IP in EspoCrm behind a proxy (nginx reverse proxy) .. only the IP of Proxy.

    do you think this is the solution ? or where i can write this kind of solution and test it ?
    Proxy send IP with header : HTTP_X_FORWARDED_FOR

    PHP Code:
    $ip $_SERVER['REMOTE_ADDR']? : ( $_SERVER['HTTP_X_FORWARDED_FOR'] ? : $_SERVER['HTTP_CLIENT_IP'] ); 
    Regards

  • #2
    Hi,

    in application/espo/core/util/auth.php

    replace all $_SERVER['REMOTE_ADDR'] by $_SERVER['HTTP_X_REAL_IP']

    Regards

    Comment


    • #3
      It is possible that the client also uses a proxy so that his IP cannot be traced.

      Comment


      • #4
        Originally posted by karlahodges View Post
        It is possible that the client also uses a proxy so that his IP cannot be traced.
        I run a Cloudflare proxy to a nginx proxy server that points to my webserver. Works great!

        Comment


        • #5
          If EspoCRM doesn't have a built-in setting for handling forwarded headers, you may need to customize the application. This often involves modifying the code to correctly extract the client's IP from the headers. EspoCRM may have hooks or event handlers that you can use for this purpose.

          Comment


          • #6
            "ipAddressServerParam" config parameter: https://docs.espocrm.com/administration/config-params/

            Comment

            Working...
            X