RicLeP / laravel-storyblok

Make Laravel and Storyblok work together beautifully.
https://ls.sirric.co.uk/
MIT License
58 stars 15 forks source link

feat: add support for custom asset domain #14

Closed brentmullen closed 3 years ago

brentmullen commented 3 years ago

Introduces the ability to use custom domains for Storyblok assets.

Two new config values: asset_domain which can be modified from the default a.storyblok.com image_service_domain which can be modified from the default img2.storyblok.com

The configuration to customize both domains is needed because:

  1. Storyblok documentation on setting up the custom asset domain links a CloudFront distribution directly to the S3 bucket, bypassing the image service.
  2. Non-image assets cannot pass through the image service, so you cannot pass all asset requests through img2.storyblok.com

In my use case, I'll have two rules set up on my domain to route requests to either a.storyblok.com or img2.storyblok.com based on the URL path.