Sign inSign up

hanger52/nginx-alpine-cloudflare

By hanger52

•Updated almost 2 years ago

Updated nginx:alpine that gets the correct public IP using CF-Connecting-IP

Image
Web servers
0

276

hanger52/nginx-alpine-cloudflare repository overview

⁠NGINX Cloudflare Public IP Docker Image

This is an nginx:alpine-based Docker image that comes with additional features to enhance NGINX functionality. The image is specifically designed to handle the client's public IP addresses when using the Cloudflare proxy.

⁠Features

⁠Cloudflare IP List Generation

The image includes a script that generates a list of Cloudflare IP addresses for use with the set_real_ip_from directive in NGINX. This list allows NGINX to correctly identify the client’s public IP address when requests are proxied through Cloudflare.

  • How it Works:
    • The script pulls the latest Cloudflare IP ranges (both IPv4 and IPv6) from Cloudflare’s public resources.
    • It also includes the container's local IP network address block in the real_ip_header configuration, ensuring that internal Docker network traffic is properly handled if originating from its gateway.
    • Cronjob runs every day to update the latest Cloudflare IP ranges.

The script is adapted from the nginx-cloudflare-real-ip⁠ repository.

⁠References

Tag summary

Content type

Image

Digest

sha256:e689d97a8…

Size

22.5 MB

Last updated

almost 2 years ago

docker pull hanger52/nginx-alpine-cloudflare:v1.0.3