{% for range in ip_ranges %} set_real_ip_from {{ range }}; {% endfor %} map $http_cf_connecting_ip $real_ip { "" $http_x_real_ip; default $http_cf_connecting_ip; } more_set_input_headers "X-IP: $real_ip"; real_ip_header X-IP;