laravel-aws-eb icon indicating copy to clipboard operation
laravel-aws-eb copied to clipboard

Cloudfront as CDN

Open dominikager opened this issue 3 years ago • 3 comments

Hi,

does anyone have experience using cloudfront as a cdn for elastic beanstalk? This should protect the application DDOS.

Thanks for any help!

dominikager avatar Jan 03 '22 18:01 dominikager

I use Elastic Beanstalk with Cloudfront. Basically, I just use webpack-s3-uploader plugin for Webpack and configure it in mix to upload to S3 and invalidate cache on upload then just configure the Base URL for Laravel

rennokki avatar Jan 12 '22 19:01 rennokki

@rennokki thanks a lot for your answer!

But i want to put the whole Applciation behind cloudfront, because of DDOS protection. Current Problem is that it directly redirects to the Domain of the Load Balancer and not to the Cloudfront URL.

dominikager avatar Jan 19 '22 10:01 dominikager

Well, Cloudfront is different from Load Balancing.

Cloudfront is mainly used for Lambda calls and serving static content from S3. Laravel is PHP-based and needs EC2/Computing to work, so you cannot have it behind Cloudfront. I think you can still achieve this by using Laravel Vapor and see if it works deploying the Lambda functions with Lambda@Edge.

rennokki avatar Jan 23 '22 10:01 rennokki