RSS feeds problem

I have a site with static file RSS feeds. The files are in the right place, and as far as I can tell I have added the correct headers directives in netlify.toml yet when I try to open the URLs in a browser, the domain disappears and the browser returns an error.

Here are the feeds:

https://markjgsmith.com/feeds

For example when I try to open the rss blog feed:

https://markjgsmith.com/feeds/blog/rss/feed.xml

the browser ends up trying to open:

https://blog/rss.markjgsmith.com/feeds/feed.xml

Here are the files after the build completes:

[drwxr-xr-x]  dist/site/feeds
├── [drwxr-xr-x]  blog
│   ├── [drwxr-xr-x]  atom
│   │   └── [-rw-r--r--]  feed.xml
│   ├── [drwxr-xr-x]  json
│   │   └── [-rw-r--r--]  feed.json
│   └── [drwxr-xr-x]  rss
│       └── [-rw-r--r--]  feed.xml
├── [-rw-r--r--]  index.html
├── [drwxr-xr-x]  links
│   ├── [drwxr-xr-x]  atom
│   │   └── [-rw-r--r--]  feed.xml
│   ├── [drwxr-xr-x]  json
│   │   └── [-rw-r--r--]  feed.json
│   └── [drwxr-xr-x]  rss
│       └── [-rw-r--r--]  feed.xml
└── [drwxr-xr-x]  podcast
    └── [-rw-r--r--]  feed.xml

Here are the netlify.toml header directives:

# Blog feeds
[[headers]]
  for = "/feeds/blog/rss/feed.xml"
  [headers.values]
    Content-Type = "text/xml"

[[headers]]
  for = "/feeds/blog/atom/feed.xml"
  [headers.values]
    Content-Type = "text/xml"

[[headers]]
  for = "/feeds/blog/json/feed.json"
  [headers.values]
    Content-Type = "text/xml"

# Linkblog feeds
[[headers]]
  for = "/feeds/links/rss/feed.xml"
  [headers.values]
    Content-Type = "text/xml"

[[headers]]
  for = "/feeds/links/atom/feed.xml"
  [headers.values]
    Content-Type = "text/xml"

[[headers]]
  for = "/feeds/links/json/feed.json"
  [headers.values]
    Content-Type = "text/xml"

# Podcast feed
[[headers]]
  for = "/feeds/podcast/feed.xml"
  [headers.values]
    Content-Type = "text/xml"

What is causing this behaviour and how can I fix it?

Hi, @mjgs. The domain points to Cloudflare:

markjgsmith.com.	21600	IN	NS	chuck.ns.cloudflare.com.
markjgsmith.com.	21600	IN	NS	yolanda.ns.cloudflare.com.
markjgsmith.com.	300	IN	A	172.67.196.208
markjgsmith.com.	300	IN	A	104.21.21.68

Those are not Netlify controlled IP address. The request never reaches Netlify. If we return a response it will always have an x-nf-request-id header. The 301 redirect below does not:

$ curl --compressed -svo /dev/null https://markjgsmith.com/feeds/blog/rss/feed.xml   2>&1 | egrep '^< '
< HTTP/2 301
< date: Mon, 12 Dec 2022 01:22:10 GMT
< location: https://blog/rss.markjgsmith.com/feeds/feed.xml
< cache-control: max-age=3600
< expires: Mon, 12 Dec 2022 02:22:10 GMT
< report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=SnHF6rx%2BTngSic6d6Ub5Sy3zLe7RYs%2B79IYaVveWx%2FkFol0W7%2B7UndyxUlNCVz7Ja6UMiPGIW9zo6%2FNXgJSAntrddM5N0%2BalzydL5lfAN4cweQr2ZI8UGS1dAMQiwBwWov8%3D"}],"group":"cf-nel","max_age":604800}
< nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
< vary: Accept-Encoding
< server: cloudflare
< cf-ray: 7782a5c1cf82efbe-PDX
< alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400
<

There is no x-nf-request-id header in the response above. If the domain is configured to proxy correctly to Netlify, then the x-nf-request-id header will be there. It isn’t there so this means Netlify didn’t send this 301.

This proves the source of the redirect is Cloudflare and not Netlify. You will need to fix this at Cloudflare.

Thanks for looking into this @luke.

Yes the DNS is on Cloudflare, I’ll take it up with them as soon as they let me login to the dashboard (currently it’s a never ending spinner).

I just moved the site to Netlify so there’s probably some wierd old config that is lurking and breaking things.