RSS Feed Redirection to FeedBurner Using Nginx
文章介绍了如何通过Nginx配置将RSS订阅重定向到FeedBurner,以实现跟踪订阅统计和扩大博客影响力。通过检查用户代理并重定向请求至FeedBurner,同时允许FeedBurner访问原始 RSS 馈送。提供了直接修改配置文件或创建独立规则的两种方法,并强调了测试和重启Nginx的重要性。 2025-5-15 13:39:7 Author: www.blackmoreops.com(查看原文) 阅读量:7 收藏

Setting up RSS feed redirection to FeedBurner using Nginx is a straightforward process that can help you track subscriber statistics and enhance your blog’s reach. This configuration redirects all feed requests to your FeedBurner account while allowing FeedBurner itself to access your original feed. In this short guide, I’ll show you how to implement RSS Feed Redirection to FeedBurner Using Nginx.

RSS Feed Redirection to FeedBurner Using Nginx - blackMORE Ops - 1

Implementation Steps

The core of the RSS feed redirection is a simple Nginx configuration that checks the user agent and redirects accordingly. Here’s how to set it up:

  1. Create or edit your site’s Nginx configuration file:
root@server:/etc/nginx/sites-enabled# vi blackmoreops.com
  1. Add the following code to your server block:
if ($http_user_agent !~ FeedBurner) {
    rewrite ^/feed/ http://feeds.feedburner.com/bmofeed last;
}
  1. Test your Nginx configuration:
root@server:/etc/nginx/sites-enabled# nginx -t
  1. Restart Nginx to apply changes:
root@server:/etc/nginx/sites-enabled# service nginx restart

Alternative Approach

You can also store the redirection rule in a separate config file and include it in your server blocks:

  1. Create a dedicated configuration file:
root@ubuntu14-upcl01:~# cat /var/www/blackmoreops.com/conf/nginx/rss_redirect.conf
if ($http_user_agent !~ FeedBurner) {
    rewrite ^/feed/ http://feeds.feedburner.com/bmofeed last;
}
  1. Set appropriate permissions:
root@ubuntu14-upcl01:~# chown -R www-data:www-data /var/www/blackmoreops.com/conf/nginx/rss_redirect.conf
  1. Test and restart Nginx:
root@ubuntu14-upcl01:~# nginx -t
root@ubuntu14-upcl01:~# service nginx restart

Conclusion

Setting up RSS feed redirection to FeedBurner with Nginx is an effective way to manage your blog’s feed distribution. This configuration ensures all feed requests are sent to FeedBurner while allowing FeedBurner itself to access your original RSS feed. With this redirection in place, you can take advantage of FeedBurner’s analytics and subscriber management features to better understand your audience.


文章来源: https://www.blackmoreops.com/2025/05/15/rss-feed-redirection-to-feedburner-using-nginx/
如有侵权请联系:admin#unsafe.sh