在AWS SDK 文档中,有以下选项:
s3ForcePathStyle(boolean)
返回是否强制S3对象的路径样式URL
我测试过它适用于这个配置:
var config = { accessKeyId: "123", secretAccessKey: "abc", endpoint: "localhost:3000", sslEnabled: false, s3ForcePathStyle: true }; AWS.config.update(config); s3Client = new AWS.S3();