-
Notifications
You must be signed in to change notification settings - Fork 104
Description
Is your feature request related to a problem? Please describe.
Yes. Currently, Nuxt Hub's S3 driver primarily relies on Path-style URLs (e.g., https://s3.region.amazonaws.com/bucket-name/key).
However, AWS has officially announced the deprecation of path-style access. For buckets created after September 30, 2020, AWS has already begun pushing users toward Virtual-hosted–style URLs (e.g., https://bucket-name.s3.region.amazonaws.com/key). Using the legacy path-style for new buckets in certain regions or configurations can lead to 403 Forbidden or 307 Temporary Redirect errors, and it limits the ability to use modern S3 features like Access Points or Object Lambda.
As more developers migrate to modern AWS regions or create new infrastructure, the lack of support for virtual-hosted style in Nuxt Hub becomes a blocker for S3-backed blob storage.
Describe the solution you'd like
I would like Nuxt Hub to support Virtual-hosted–style URLs in the S3 blob driver.
Specifically:
Configuration Toggle: Add a configuration option in hub.blob (e.g., forcePathStyle: false or addressingStyle: 'virtual') to allow users to choose their preferred URL format.
Modern Default: Ideally, the driver should follow the latest AWS SDK v3 behavior where virtual-hosted style is the default, while still allowing path-style for legacy/on-premise S3-compatible storage (like MinIO).
Describe alternatives you've considered
Manual Endpoint Overriding: I tried setting a custom S3_ENDPOINT (e.g., https://my-bucket.s3.us-east-1.amazonaws.com), but the underlying SDK/driver often appends the bucket name to the path again, resulting in an invalid URL like https://my-bucket.s3.us-east-1.amazonaws.com/my-bucket/key. See:
core/src/blob/lib/drivers/s3.ts
Line 82 in 9ef85d6
| const bucketUrl = options.endpoint && options.bucket ? `${baseEndpoint}/${options.bucket}` : baseEndpoint |
Additional context
Reference Links:
AWS Official Announcement on Path-style Deprecation: Amazon S3 Path Deprecation Plan – The Rest of the Story
AWS Documentation - Virtual Hosting of Buckets: Working with Amazon S3 Buckets
This change is critical for ensuring Nuxt Hub remains compatible with the current and future state of AWS infrastructure.