title: how to log client real ip and also CDN ip?
body: <p>I'm using cloudflare for my website.</p>
  
  <p>The issue I got is, after I enabled realip module on nginx, all CDN ips are replaced to user's realip. Then when I check the nginx log, I can't find out whether user is connecting via CDN or connection directly to server.</p>
  
  <p>Below is my configuration:</p>
  
  <pre><code>set_real_ip_from 103.21.244.0/22;
  set_real_ip_from 103.22.200.0/22;
  ...
  real_ip_header X-Forwarded-For;
  
  ....
  log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
  '$status $body_bytes_sent "$http_referer" '
  </code></pre>
  
  <p>Is there any way I can keep both realip and CDN IPs?</p>