add logic to test for reverse proxy before setting ip for counter