NGINX Proxy Breaks Apache Logging and Perl $ENV{'REMOTE_ADDR'}
After installing ea-nginx, I've noticed that I've lost $ENV{'REMOTE_ADDR'} in Perl (or rather it just shows me the server's IP address and I can't grep my way through the server's Apache error_log because there are no IP Addresses recorded. Is there a cPanel officially supported way to fix this?
I found this article on how to adjust the NGINX and Apache settings to properly forward IP addresses for Apache logging (and maybe this would help with REMOTE_ADDR, too?) but I can't figure out how to implement it in a way that doesn't require me to interact with parts of Apache's configuration that cPanel will overwrite. Hopefully there is an official way to fix this?
Thanks!
-
I found out that $ENV{'HTTP_X_REAL_IP'} is equivalent to what $ENV{'REMOTE_ADDR'} previously provided. So, my Perl scripts can gain get an accurate IP address (although it seems like it would be cleaner if cPanel configured the Nginx-Apache combo to correct REMOTE_ADDR so scripts do not need to be modified. That still doesn't solve the logging issue, however -- Apache's error_log is almost unusable for debugging if I can't do a grep for a particular IP address when trying to watch it. 0 -
I'll send in a ticket -- I installed that module, but there aren't an IP addresses written into Apache's error_log still. 0 -
Weird - when you do that, can you post the ticket number here so I can follow along? 0 -
Sure -- I'll do it as soon as I can log in. I have my cPanelID password saved to my password manager, but it is rejecting it this morning all the same when I try to log in, so I'm trying to reset it. 0 -
OK, here's the ticket number: #94313836 . Thank you so much, @cPRex! 0 -
Thanks! I'm following along with that on my end now so I'll be sure to keep this thread updated once we hear anything. 0
Please sign in to leave a comment.
Comments
7 comments