Skip to content

Commit 58cbc38

Browse files
Updated readme
1 parent abbe587 commit 58cbc38

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

+18
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,24 @@ distribution:
7171
- https://my-bucket.s3.amazonaws.com
7272
```
7373
74+
#### Custom header on origin
75+
Custom headers supports a key-value object.
76+
```yml
77+
# serverless.yml
78+
79+
distribution:
80+
component: '@serverless/aws-cloudfront'
81+
inputs:
82+
origins:
83+
- url: https://my-assets.com
84+
pathPatterns:
85+
/static/images: # route any /static/images requests to https://my-assets.com
86+
ttl: 10
87+
allowedHttpMethods: ['GET', 'HEAD'] # optional
88+
headers:
89+
x-api-key: apikey # Add any custom header to be sent with the request to the origin
90+
```
91+
7492
#### Custom cache behavior
7593
Custom cache behaviors support the same config parameters as the default cache behavior (see the example above).
7694
```yml

0 commit comments

Comments
 (0)