mirror of
https://github.com/ergin/nginx-cloudflare-real-ip.git
synced 2026-04-25 05:15:53 +03:00
[GH-ISSUE #7] Script stop working correctly. #1
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-cloudflare-real-ip#1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
@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 justhttps://www.cloudflare.com/ips-v4andhttps://www.cloudflare.com/ips-v6/instead of justhttps://www.cloudflare.com/ips-v6. This worked for me.(I also use
curl -sso that curl doesn't report back on its download progress.)@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.