Serving external static file from cloudflare

I have an external static file that sits in an Azure Cloud Storage account. It is publicly accessible from anywhere on the internet.

I am wondering if it’s possible for this file to be served from a URI on the domain I have in Cloudflare. For example, where sitemap.xml is the name of the static file sitting in my azure cloud storage account and example.com is the domain I manage in Cloudflare:

https://example.com/sitemap.xml

Many thanks in advance.

Why not just keep the file with the rest of the files on your site?

I guess I lied about it being totally static. It updates occasionally, a couple of times per week. It’s my website’s sitemap.xml. Whenever a new URL on our site is created, it’s added to the sitemap.xml.

It’d be much easier to run a cronjob on the server to pull that file over every so often.

Even better, it looks like you can specify a cross-domain sitemap from robots.txt

I read that too. Seems like I can see the light.

1 Like

Let’s say I insisted on serving the external file from my domain like I originally asked in the question. Is it even possible with cloudflare to do so?

There are some Workers examples to pull content from another source. There’s a Fetch HTML which might work, and a Respond With Another Site.

These workers are pretty nifty. Was able to do exactly what I wanted. Thanks sdayman!

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.