[GH-ISSUE #7] Script stop working correctly. #1

Closed
opened 2026-02-25 22:30:23 +03:00 by kerem · 2 comments
Owner

Originally created by @iovcho on GitHub (Feb 23, 2022).
Original GitHub issue: https://github.com/ergin/nginx-cloudflare-real-ip/issues/7

Hello. The scripts works correctly, but I don't know when is stopped.
The problem IP addresses are missing in file /etc/nginx/cloudflare

[root@server ~]# cat /etc/nginx/cloudflare
#Cloudflare

- IPv4

- IPv6

real_ip_header CF-Connecting-IP;
[root@server ~]#

I try to download the script again, but its not working. If I run in manualy here is the output:

[root@server~]# /usr/scripts/cloudflare-sync-ips.sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

but in the file /etc/nginx/cloudflare IPs are missing.

Originally created by @iovcho on GitHub (Feb 23, 2022). Original GitHub issue: https://github.com/ergin/nginx-cloudflare-real-ip/issues/7 Hello. The scripts works correctly, but I don't know when is stopped. The problem IP addresses are missing in file /etc/nginx/cloudflare [root@server ~]# cat /etc/nginx/cloudflare #Cloudflare # - IPv4 # - IPv6 real_ip_header CF-Connecting-IP; [root@server ~]# I try to download the script again, but its not working. If I run in manualy here is the output: [root@server~]# /usr/scripts/cloudflare-sync-ips.sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful but in the file /etc/nginx/cloudflare IPs are missing.
kerem closed this issue 2026-02-25 22:30:23 +03:00
Author
Owner

@ChrisHardie commented on GitHub (Feb 23, 2022):

@iovcho it looks like Cloudflare recently redirected those API endpoints to a new location, and I don't think curl is following that redirect by default. Try adding a trailing slash to the end of the URLs, e.g. https://www.cloudflare.com/ips-v4/ instead of just https://www.cloudflare.com/ips-v4 and https://www.cloudflare.com/ips-v6/ instead of just https://www.cloudflare.com/ips-v6. This worked for me.

(I also use curl -s so that curl doesn't report back on its download progress.)

<!-- gh-comment-id:1048895309 --> @ChrisHardie commented on GitHub (Feb 23, 2022): @iovcho it looks like Cloudflare recently redirected those API endpoints to a new location, and I don't think curl is following that redirect by default. Try adding a trailing slash to the end of the URLs, e.g. `https://www.cloudflare.com/ips-v4/` instead of just `https://www.cloudflare.com/ips-v4` and `https://www.cloudflare.com/ips-v6/` instead of just `https://www.cloudflare.com/ips-v6`. This worked for me. (I also use `curl -s` so that curl doesn't report back on its download progress.)
Author
Owner

@ergin commented on GitHub (Feb 24, 2022):

Hello,
@iovcho thanks for the issue you have submitted, and @ChrisHardie thanks for the tips you have shared. An update has applied to the shell script for the HTTP 301 redirects.

<!-- gh-comment-id:1050033174 --> @ergin commented on GitHub (Feb 24, 2022): Hello, @iovcho thanks for the issue you have submitted, and @ChrisHardie thanks for the tips you have shared. An update has applied to the shell script for the HTTP 301 redirects.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-cloudflare-real-ip#1
No description provided.