-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
S3 Nginx Proxy
David Rivera edited this page Jan 31, 2024
·
5 revisions
It's a common concept to put a proxy in front of S3 that handles requests. Nginx is well suited for this and can be used to handle TLS and virtual-hosted style bucket URLs (using subdomains instead of subfolders).
For virtual-hosted style URL buckets, you'll need to add a wildcard DNS record for your S3 subdomain.
upstream seaweedfs { server localhost:8333 fail_timeout=0; keepalive 20;}
## Also you can use unix domain socket instead for better performance:
# upstream seaweedfs { server unix:/tmp/seaweedfs-s3-8333.sock; keepalive 20;}
server {
listen 443 ssl;
# Assumes that your subdomain is s3
# The regex will support path style as well as virtual-hosted style bucket URLs
# path style: http://s3.yourdomain.com/mybucket
# virtual-hosted style: http://mybucket.s3.yourdomain.com
server_name ~^(?:(?<bucket>[^.]+)\.)s3\.yourdomain\.com;
ignore_invalid_headers off;
client_max_body_size 0;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_connect_timeout 300;
proxy_http_version 1.1;
proxy_set_header Connection "";
chunked_transfer_encoding off;
# If bucket subdomain is not empty,
# rewrite request to backend.
if ($bucket != "") {
rewrite (.*) /$bucket$1 last;
}
location / {
proxy_pass http://seaweedfs;
}
ssl on;
ssl_certificate /{path_to_ssl_cert}/cert.pem;
ssl_certificate_key /{path_to_ssl_cert}/key.pem;
}
- Replication
- Store file with a Time To Live
- Failover Master Server
- Erasure coding for warm storage
- Server Startup Setup
- Environment Variables
- Filer Setup
- Directories and Files
- Data Structure for Large Files
- Filer Data Encryption
- Filer Commands and Operations
- Filer JWT Use
- Filer Cassandra Setup
- Filer Redis Setup
- Super Large Directories
- Path-Specific Filer Store
- Choosing a Filer Store
- Customize Filer Store
- Migrate to Filer Store
- Add New Filer Store
- Filer Store Replication
- Filer Active Active cross cluster continuous synchronization
- Filer as a Key-Large-Value Store
- Path Specific Configuration
- Filer Change Data Capture
- Cloud Drive Benefits
- Cloud Drive Architecture
- Configure Remote Storage
- Mount Remote Storage
- Cache Remote Storage
- Cloud Drive Quick Setup
- Gateway to Remote Object Storage
- Amazon S3 API
- AWS CLI with SeaweedFS
- s3cmd with SeaweedFS
- rclone with SeaweedFS
- restic with SeaweedFS
- nodejs with Seaweed S3
- S3 API Benchmark
- S3 API FAQ
- S3 Bucket Quota
- S3 API Audit log
- S3 Nginx Proxy
- Docker Compose for S3
- Hadoop Compatible File System
- run Spark on SeaweedFS
- run HBase on SeaweedFS
- run Presto on SeaweedFS
- Hadoop Benchmark
- HDFS via S3 connector
- Async Replication to another Filer [Deprecated]
- Async Backup
- Async Filer Metadata Backup
- Async Replication to Cloud [Deprecated]
- Kubernetes Backups and Recovery with K8up