301 redirects back to origin site

Our provider is offering Cloudflare CDN in our hosting package and is also managing the DNS entries to enable that.
Our website is www.argusmonitor.com and all the stuff I want to have cached I will have to refer to by using cdn.argusmonitor.com. This seems to be working in general, but if I look closely, I can see that Cloudflare is redirecting the requests back to our site?!.

This is done using a 301 (moved permanently) redirect and not only once (as would be expected after purging the cache) but also after days.

For example:

$> curl -l https://cdn.argusmonitor.com/assets/en/screen06.png

301 Moved Permanently

Moved Permanently

The document has moved here.


Apache Server at cdn.argusmonitor.com Port 80

I have no rules or anything I am aware of set up, but the issue started after logging in to the Dashboard, so MAYBE I have changed something by accident (the only thing I wanted to do was changing the cache TTL to 16 days).

Can anyone tell my what might be wrong or what I am missing that my content does not get cached anymore?

OK, the overzealous auto-format was messing up my example – so here it is again:

`
$> curl -l https://cdn.argusmonitor.com/assets/en/screen06.png

301 Moved Permanently

Moved Permanently

The document has moved here.


Apache Server at cdn.argusmonitor.com Port 80 `

That is most definitely not Cloudflare doing the redirect. And it looks like your setup is badly misconfigured. You used a ‘curl’ command to HTTPS, but the server is responding on Port 80.

Yes, thanks a lot. The problem indeed seemed to be ‘home made’. I had some rewrite rules that must have prevented the cache from being filled (this is my working hypothesis at the moment).

At least if I prepend the rules I have with

RewriteCond %{HTTP_HOST} !^cdn.argusmonitor.com$ [NC

then it seems to work. At least those 301 redirects have gone away.

1 Like

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