How to show real client's IP in cPanel log when using Nginx proxy in front
Hello,
I have a domain domain.com, my Nginx proxy server's IP is A.A.A.A.
I point domain.com to A.A.A.A and my Nginx proxy pass to my cPanel server.
I already set "proxy_set_header X-Real-IP $remote_addr;" in vhost config on my proxy server.
The apache logs showing client's real IP, but cPanel logs only show proxy's IP, not client's IP.
Like in this log /usr/local/cpanel/logs/login_log
info [webmaild] A.A.A.A - user "POST /login/?login_only=1 HTTP/1.1" FAILED LOGIN webmaild: user password hash is missing from system (user probably does not exist)
info [cpaneld] A.A.A.A - user "POST /login/?login_only=1 HTTP/1.0" FAILED LOGIN cpaneld: invalid cpanel user user (has_cpuser_file failed)
info [whostmgrd] A.A.A.A - root - SUCCESS LOGIN whostmgrd
info [whostmgrd] A.A.A.A - root - SUCCESS LOGIN cpaneld
info [cpaneld] A.A.A.A - user (possessor: root) - SUCCESS LOGIN cpaneld
Or lastlogin log in User home directory: /home/user/.lastlogin
A.A.A.A # 2023-10-10 17:26:32 +0700
A.A.A.A # 2023-10-19 14:38:03 +0700
As you can see, my cpanel login's log only show Proxy IP A.A.A.A when login into WHM, cPanel or Webmail, not client's IP.
So how can i config cPanel to show client's real IP in cPanel log ?
Thank you.
Please sign in to leave a comment.
Comments
0 comments