Skip to content

Instantly share code, notes, and snippets.

@pedxyuyuko
Created July 1, 2019 07:50
Show Gist options
  • Select an option

  • Save pedxyuyuko/72723f993406e5df4c9819f6b3b57b3f to your computer and use it in GitHub Desktop.

Select an option

Save pedxyuyuko/72723f993406e5df4c9819f6b3b57b3f to your computer and use it in GitHub Desktop.
Real IP behind CDN | Nginx in http
# in http
http{
map $http_x_forwarded_for $real_ip {
"" $remote_addr;
~^(?P<firstAddr>[0-9\.]+),?.*$ $firstAddr;
}
}
real ip: $real_ip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment