I'm always excited to take on new projects and collaborate with innovative minds.
+855 12 282 686
samnangrosady9@gmail.com
Rclone with Cloudflare R2 and Nginx reverse proxy for enhanced cloud storage management and secure data transfer.

Rclone is a powerful command-line tool that allows you to sync, copy, and manage files across multiple cloud storage providers. Cloudflare R2 is an object storage service designed to provide low-latency, high-availability storage without egress fees. By integrating Rclone with Cloudflare R2, you can efficiently manage your cloud storage with ease.
sudo yum install epel-release
sudo yum -y install fuse rclone -y
ln -s /bin/fusermount /bin/fusermount3vim ~/.config/rclone/rclone.conf
[r2demo]
type = s3
provider = Cloudflare
access_key_id = xxx
secret_access_key = xxxx
endpoint = xxxxx
region = auto
acl = private"
Option 1 (Debugging):
rclone mount r2demo:<bucket-name> <local-destination> --vfs-cache-mode off --log-file rclone.log --log-level DEBUGOption 2: Run in the background
nohup rclone mount r2demo:<bucket-name> <local-destination> --vfs-cache-mode off --log-file /var/log/rclone.log --log-level NOTICE > /dev/null 2>&1 &
Using --log-file, in case of debugging.
--log-level LEVEL
ln -s <local-destination> <project-storage-destination>
✅ Faster global delivery due to Cloudflare’s CDN caching. ✅ Potential cost savings by reducing server bandwidth usage. ✅ Decreased load on server, especially for high-traffic websites.
map $uri $new_uploads_uri {
~^/<storage-uri>/(.*)$ //$1;
}
server {
.....
location ^~ /<storage-uri>/ {
resolver 1.1.1.1;
proxy_ssl_server_name on;
proxy_pass https://<public-r2-domain>$new_uploads_uri;
}
}
Sample:
< storage-uri >: wp-content/upload. We want to reverse from $HOST/wp-content/upload/xxx/xxx/xxx.jpg to <public-r2-domain>/upload/xxx/xxx/xxx.jpg
By combining Rclone, Nginx, and Cloudflare R2, you can serve static files efficiently with:
✅ Custom domain support
✅ SSL encryption
✅ Caching & compression
✅ No egress fees
🌟 Stay tuned 🌟
Full content:Dev.to
Your email address will not be published. Required fields are marked *