S3_PUBLIC_URL (custom domain) serves objects at /<name>, not /<bucket>/<name>. Only include bucket prefix when falling back to the S3 endpoint path-style URL.
S3_PUBLIC_URL (custom domain) serves objects at /<name>, not /<bucket>/<name>. Only include bucket prefix when falling back to the S3 endpoint path-style URL.