Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/VirtuBox/nginx-cloudflare-real-ip

Bash script to restore visitor real IP under Cloudflare with Nginx
https://github.com/VirtuBox/nginx-cloudflare-real-ip

bash-script cloudflare http-realip nginx ufw-firewall

Last synced: 4 days ago
JSON representation

Bash script to restore visitor real IP under Cloudflare with Nginx

Awesome Lists containing this project

README

        

# nginx-cloudflare-real-ip

Configure Nginx to restore Visitors real IP under Cloudflare CDN

## Features

* Get Cloudflare IPv4 + IPv6 list and create nginx configuration to restore visitors real IP in `/etc/nginx/conf.d/cloudflare.conf`
* Whitelist Cloudflare IPs on port 80 & 443 with UFW (optional)

## Requirements

* Nginx built with http_realip_module

You can check if http_realip_module available with :

```bash
nginx -V 2>&1 | grep with-http_realip_module
```

If the previous command return nothing, http_realip_module isn't available

---

## Usage

Nginx configuration only

```bash
bash <(wget -O - vtb.cx/nginx-cloudflare || curl -sL vtb.cx/nginx-cloudflare)
```

Nginx configuration + UFW configuration

```bash
bash <(wget -O - vtb.cx/nginx-cloudflare || curl -sL vtb.cx/nginx-cloudflare) --ufw
```

Published & maintained by [VirtuBox](https://virtubox.net)