How to cache files behind secure nginx links?

I have a file that secured behind nginx proxy link.
The url schema is simillar to:$mdf=jddjdhhh
The secure link is changable every time depend on usr location and request time.
I made a curl to the upper link from my PC and wait till Cloudflare cache the file , then i request a new secure link that acutally lead to the same file and curl the new link. I found that Cloudflare said that the file is missing in cache while it is the same file just different link pattern.
How i tell Cloudflare to cache file with url:
regarding the parameters after that link?

That should be possible with a page rule and setting the caching level to ignore the query string.

Unfortunately some areas of Cloudflare currently return an error, so I cant post a screenshot.

Thanks for reply.

Assuming the generated secure link is:

Here is the pattern i use to find the last parametres:


Now, how i tell Cloudflare to ignore the last characters in url using the upper patteren?


/files/* should work. It will apply to all files in that directory though, only only TXT files.

That simple enough @sandro .

So what is the next steps after making this regex?

How to tell Cloudflare to cache that file no matter how the ?md5=cw6nflZRwn1PGPowqf6MBw&amp;expires=1548497943 change?

One a second thought, the issue would be that the file is always served regardless of whether the code is valid or not and you probably dont want that.

If you really want to outsource that to Cloudflare your only option might be implementing a Cloudflare worker.

That is come across my thought two.

Any documentation about how to implement Cloudflare workers?

Or do you have a simple guide about it?

@sandro , thank you very much for your help and your time.

I will take a look to documenations .


This topic was automatically closed after 31 days. New replies are no longer allowed.