rennokki/laravel-aws-eb

Cloudfront as CDN

dominikager opened this issue · 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!

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 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.

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.