I’m running a Nodejs/Nginx stack under AWS/ElasticBeanstalk. I was having an issue where I needed my server to log the full path to the request, but all it was logging was requests from the load balancer, (172.31.xx.xx). I had to get AWS support to help debug the issue, and they were able to get the Nginx server to properly log the requests, so I had access to the full path, not the load balancer.
I imagine to fix this, you will have to do a similar change to PHP.