I need a little bit help with some issues I am facing around.
Basically I am having a website where a user should select the file they want to download. Then on my server end it generates an encrypted download URL that contains a timestamp and the ip address of the user fetched from cf-connecting-ip header. Now after generating the user automatically get redirected to cloudflare worker i.e the download portal. There again users ip is fetched from same header. Then the ip address and encrypted url is sent to the server via a post request to check if remote ip is matching. And did the download link expire or not.
Everything is going as I expected. But somehow the ip address fetched on the server and the same fetched from cloudflare workers are showing differently.
xxx.yyy.164.2 this ip is fetched from the server
xxx.yyy.134.194 this from the cloudflare worker.
(xxx and yyy are same values in both the IPs)
As the IP address is getting mismatched the downloads get aborted. Redirecting back to the download page.
Someone help me if they know why this is happening and anyway to fix it up.
And sorry if I am not able to explain this properly. But any help is appreciated.