1

I have created an RSS and Atom feed as specified here. You can view my example feeds: RSS or Atom.

The files are both called feed.feedtype.twig, as specified. I am running Craft CMS 4.

As you can see from visiting both links, the feeds load in your browser, but the console says there is a 404 error. Consequently, the feeds do not validate.

It is worth mentioning I have set up caching as per this article. I don't know why that should affect anything, but I do know I don't have this problem locally with DDEV.

What am I doing wrong?

Edit: it turns out I had an nginx error on my server. It allowed the feed to be viewed, but not fetched remotely. My apologies!

1 Answer 1

1

It turns out I had an nginx error on my server. It allowed the feed to be viewed, but not fetched remotely. My apologies!

In brief: I had the following lines setup in my nginx.conf file:

# Directives to send expires headers and turn off 404 error logging.
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
           access_log off; log_not_found off; expires max;
}

All I had to do was remove RSS and Atom from that list.

# Directives to send expires headers and turn off 404 error logging.
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
           access_log off; log_not_found off; expires max;
}

Everything loads now, thankfully.

2
  • Feel free to mark your own answer as "The Answer", its allowed and encouraged to help others find solved / unsolved questions. Cheers!
    – cherrykoda
    Commented Oct 12, 2023 at 13:12
  • 1
    I can accept it as the answer in 3 hours — thanks!
    – nathan_393
    Commented Oct 13, 2023 at 14:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.