If you have the trusted-cgi running behind a reverse proxy then the Remote IP address detected will be the internal IP address of the reverse proxy.
Is it possible to detect the client IP address using the Request Header Value e.g. X-Forwarded-For
This is usually the header that the proxies pass on to the backend server so they are aware of the original client IP address.