Table of Contents	
How to Connect PeaSoup S3 to Fastly
Follow these steps to configure your Fastly service to deliver content stored on PeaSoup S3. Since PeaSoup provides an S3-compatible API, you can configure it similarly to Amazon S3 as an origin for content delivery via Fastly’s CDN.
Prerequisites
- PeaSoup S3 Access: Ensure you have the following details:- Access key
- Secret key
- Bucket name
- PeaSoup S3 endpoint URL https://s3.eu-west-1.peasoup.cloud
 
- Fastly Account with CDN services enabled.
Steps to Connect PeaSoup S3 to Fastly
- Log into Fastly Dashboard:- Go to the Fastly Dashboard and log in using your Fastly account credentials.
 
- Create a New Fastly Service:- From the Fastly dashboard, click Create Service to start setting up a new CDN service for delivering content from PeaSoup S3.
- Choose your service domain and set up your configurations.
 
- Configure PeaSoup S3 as an Origin:- In the Origins tab of your service configuration, click Add a new origin.
- Provide the following details to set up PeaSoup S3 as an origin:- Address: Enter the PeaSoup S3 endpoint https://s3.eu-west-1.peasoup.cloud
- Host: Enter the full bucket name URL, such as your-bucket.s3.eu-west-1.peasoup.cloud
- Origin Shield: Enable if needed for performance optimization, choosing the shield location closest to your users.
 
- Click Save to add PeaSoup S3 as an origin server.
 
- Configure Headers for Authentication (Optional):- If PeaSoup S3 requires authentication for access, set up custom headers for access key and secret key authentication.- Go to Headers in the Fastly configuration and click Add a header.
- In the header configuration, enter the following:- Name: Authorization
- Value: Use your access key and secret key in the following format: Bearer YOUR_ACCESS_KEY:YOUR_SECRET_KEY
 
- Name: 
 
 
- If PeaSoup S3 requires authentication for access, set up custom headers for access key and secret key authentication.
- Configure Caching Rules:- Navigate to the Caching settings in Fastly and configure cache control rules for the content delivered from PeaSoup S3.
- You can set different cache durations for static files (e.g., images, CSS, JavaScript) and dynamic content.
 
- Set up Custom VCL (Optional):- If you need more advanced control over how Fastly interacts with PeaSoup S3, you can edit the VCL (Varnish Configuration Language) directly.
- Go to the VCL section in Fastly and add custom VCL code to modify request and response handling for PeaSoup S3.
- Here’s an example of a custom VCL snippet to handle S3-compatible requests:sub vcl_recv { if (req.url ~ “^/your-s3-bucket”) { set req.backend = your_s3_backend; } }
 
- Test the Integration:- Once PeaSoup S3 is configured as an origin, deploy the changes and test accessing your content through Fastly to ensure everything is working correctly.
- Verify that content from PeaSoup S3 is being cached and delivered properly through Fastly’s CDN.
 
Notes
- Ensure that PeaSoup S3 is accessible over the internet and that appropriate permissions are set for Fastly to access the bucket content.
- Fastly allows flexible integration with S3-compatible storage, including PeaSoup S3, to enhance content delivery with caching and performance optimization.
