Cloudflare를 사용한 Nginx 역방향 DNS

Cloudflare를 사용한 Nginx 역방향 DNS

https://www.nginx.com/resources/wiki/modules/rdns/

https://github.com/flant/nginx-http-rdns

nginx-http-rdns 모듈이 cloudflare 무료 DDoS 보호와 함께 작동하도록 하려면 어떻게 해야 합니까? 이 모듈을 사용하여 검색 엔진 봇을 확인하고 싶습니다(문제 #10에는 봇을 확인하는 방법이 있습니다). 하지만 이 모듈을 cloudflare DDoS와 함께 작동하게 만드는 방법은 알려져 있지 않습니다(문제 #19 - stackoverflow 예가 있음). 누구든지 도와줄 수 있나요? 아니면 이 모듈 없이도 할 수 있는 방법이 있을까요?

예: https://stackoverflow.com/questions/62445810/nginx-http-rdns-with-cloudflare

답변1

당신은실제 모듈CloudFlare의 주소를 클라이언트의 IP 주소로 대체합니다. 이것은 처음에 발생합니다.단계다른 작업이 완료되기 전에 처리합니다. 그러면 RDNS 모듈이 정상적으로 작동하고 CloudFlare가 아닌 클라이언트의 IP 주소를 볼 수 있습니다.

예시 구성(IP 범위오래된 것일 수도 있습니다. 확인해 볼 필요가 있습니다):

set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
set_real_ip_from 104.16.0.0/12;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 131.0.72.0/22;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 162.158.0.0/15;
set_real_ip_from 172.64.0.0/13;
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 188.114.96.0/20;
set_real_ip_from 190.93.240.0/20;
set_real_ip_from 197.234.240.0/22;
set_real_ip_from 198.41.128.0/17;
set_real_ip_from 2400:cb00::/32;
set_real_ip_from 2405:8100::/32;
set_real_ip_from 2405:b500::/32;
set_real_ip_from 2606:4700::/32;
set_real_ip_from 2803:f800::/32;
set_real_ip_from 2c0f:f248::/32;
set_real_ip_from 2a06:98c0::/29;
real_ip_header CF-Connecting-IP;

관련 정보