I want to serve my S3 images with cloudfront, I've tried to change:
'domain' => 'https://'.env('AWS_BUCKET').'.s3.amazonaws.com',
in medialibrary.php to be the link to cloudfront but it doesn't register the change. not sure what I'm doing wrong.
Hi,
You can do something like this (replacing the full value):
's3' => [
/*
* The domain that should be prepended when generating urls.
*/
'domain' => env('AWS_CLOUDFRONT_URL'),
],
Then, inside your .env file add your cloudfront url:
AWS_CLOUDFRONT_URL=https://xxxx.cloudfront.net
With 8.0 use config/filesystems.php
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_S3_CLOUDFRONT'),
],
Most helpful comment
With 8.0 use config/filesystems.php