---
title: "Deploy simple-bucket-proxy"
description: "A simple Railway bucket proxy with proper cache-control headers"
category: "Storage"
url: https://railway.com/deploy/simple-bucket-proxy
---

# Deploy simple-bucket-proxy

A simple Railway bucket proxy with proper cache-control headers

**[Deploy simple-bucket-proxy on Railway](https://railway.com/template/simple-bucket-proxy)**

- **Creator:** FVM
- **Category:** Storage
- **Total deploys:** 5

## Template content

### simple-bucket-proxy

- **Image:** ghcr.io/railwayapp/function-bun:1.3.0
- **Start command:** `./run.sh aW1wb3J0IHsgSG9ubyB9IGZyb20gImhvbm8iOwppbXBvcnQgeyBjb3JzIH0gZnJvbSAiaG9uby9jb3JzIjsKaW1wb3J0IHsgUzNDbGllbnQgfSBmcm9tICJidW4iOwppbXBvcnQgeyBzdHJlYW0gfSBmcm9tICJob25vL3N0cmVhbWluZyI7Cgpjb25zdCBhcHAgPSBuZXcgSG9ubygpOwoKY29uc3QgY2xpZW50ID0gbmV3IFMzQ2xpZW50KHsKICBhY2Nlc3NLZXlJZDogQnVuLmVudi5TM19BQ0NFU1NfS0VZX0lELAogIHNlY3JldEFjY2Vzc0tleTogQnVuLmVudi5TM19TRUNSRVRfQUNDRVNTX0tFWSwKICBidWNrZXQ6IEJ1bi5lbnYuUzNfQlVDS0VULAogIGVuZHBvaW50OiBCdW4uZW52LlMzX0VORFBPSU5ULAp9KTsKCmFwcC51c2UoIi8qIiwgY29ycygpKTsKCmFwcC5nZXQoIi8qIiwgYXN5bmMgKGMpID0+IHsKICBjb25zdCBwYXRobmFtZSA9IGMucmVxLnBhdGg7CgogIGlmIChwYXRobmFtZSA9PT0gIi8iKSB7CiAgICByZXR1cm4gYy5ub3RGb3VuZCgpOwogIH0KCiAgY29uc3QgczNmaWxlID0gY2xpZW50LmZpbGUocGF0aG5hbWUpOwogIGlmICghKGF3YWl0IHMzZmlsZS5leGlzdHMoKSkpIHsKICAgIHJldHVybiBjLm5vdEZvdW5kKCk7CiAgfQoKICBjb25zdCBtZXRhID0gYXdhaXQgczNmaWxlLnN0YXQoKTsKCiAgaWYgKG1ldGEudHlwZSkgewogICAgYy5oZWFkZXIoIkNvbnRlbnQtVHlwZSIsIG1ldGEudHlwZSk7CiAgfQogIGlmIChtZXRhLmV0YWcpIHsKICAgIGMuaGVhZGVyKCJFVGFnIiwgbWV0YS5ldGFnKTsKICB9CiAgaWYgKG1ldGEubGFzdE1vZGlmaWVkKSB7CiAgICBjLmhlYWRlcigiTGFzdC1Nb2RpZmllZCIsIG1ldGEubGFzdE1vZGlmaWVkLnRvR01UU3RyaW5nKCkpOwogIH0KCiAgYy5oZWFkZXIoIkNhY2hlLUNvbnRyb2wiLCAicHVibGljLCBtYXgtYWdlPTM2MDAiKTsKCiAgcmV0dXJuIHN0cmVhbShjLCBhc3luYyAoc3RyZWFtKSA9PiB7CiAgICBhd2FpdCBzdHJlYW0ucGlwZShzM2ZpbGUuc3RyZWFtKCkpOwogIH0pOwp9KTsKCkJ1bi5zZXJ2ZSh7CiAgcG9ydDogQnVuLmVudi5QT1JUID8/IDMwMDAsCiAgZmV0Y2g6IGFwcC5mZXRjaCwKfSk7Cg==`
- **Public domain:** Yes

## Buckets

- **expandable-burrito**

## Documentation

# Deploy and Host **simple-bucket-proxy** on Railway

A simple Railway bucket proxy with proper cache-control headers.

⚠️ **Warning:** This will make your bucket publicly accessible.

Standard Railway egress costs will apply, since all content is delivered by the service itself.

Any request to `/*`, where `*` represents the path to an object in the bucket, will be served by the function endpoint.

The default cache-control TTL is **1 hour**.

---

## About Hosting **simple-bucket-proxy**

This project is a lightweight Bun function that streams the contents of a connected Railway bucket.

It serves the use case described in Railway docs here: https://docs.railway.com/storage-buckets/uploading-serving#serve-files-with-a-backend-proxy

---

## Common Use Cases

- Direct access to files stored in a Railway bucket  
- No need to manage bucket authentication  
- Clean, user-friendly URLs for your files  

---

## Requirements

- Railway Bucket  
- Bun Function  

---

## Demo

**Live Demo:** https://function-bun-production-6cf5.up.railway.app/123.json

---

## Dependencies for simple-bucket-proxy Hosting

None. All environment variables will be automatically populated during deployment.

---

## Why Deploy **simple-bucket-proxy** on Railway?

Railway provides a unified platform to deploy your entire infrastructure stack. It handles configuration and scaling for you—both vertically and horizontally—so you can focus on building.

By deploying **simple-bucket-proxy** on Railway, you’re one step closer to powering a complete full-stack application with minimal overhead. Host your servers, databases, AI agents, and more on Railway.

## Similar templates

- [Garage S3 Storage](https://railway.com/deploy/garage-s3-storage) — Ultra-light S3 server: fast, open-source, plug-and-play.
- [Redis](https://railway.com/deploy/redis-1) — Self Host Latest Redis with Railway
- [EasyImg](https://railway.com/deploy/easyimg) — Simple self-hostable Nuxt.js personal image hosting system.

Open this page in a browser: https://railway.com/deploy/simple-bucket-proxy
