You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While reviewing the Lambda logs of a server-side website construct, I see that certain requests which are usually correctly forwarded to static assets S3 bucket are sometimes forwarded to AWS Lambda. This obviously results in 404 errors.
For example:
/pwa/favicon-196.png
[2024-05-02T04:42:53.958839+00:00] logger.ERROR: Not found. {"exception":"[object] (Slim\\Exception\\HttpNotFoundException(code: 404): Not found. at /var/task/vendor/slim/slim/Slim/Middleware/RoutingMiddleware.php:76)","method":"GET","url":"http://xxx.execute-api.ap-southeast-1.amazonaws.com:443/pwa/favicon-196.png","referrer":"https://xxx.execute-api.ap-southeast-1.amazonaws.com/en/?fbclid=IwZXh0bgNhZW0CMTEAAR0PtKUWFWvg9PHimsA-6y84pOkK1FCcxbf8O8rlYmLo-u4xO0FrUOPvUAI_aem_AUtxay_7VRn54mDn_VJ2ugNPswgywsH06JRX-4GNQtqEbT1X5nKuV2dxh6dy4ONv4ruNRgfEB-i2ikvz9ur6sUOa"} []
/img/logos/logo.jpg
[2024-05-02T04:43:24.136274+00:00] logger.ERROR: Not found. {"exception":"[object] (Slim\\Exception\\HttpNotFoundException(code: 404): Not found. at /var/task/vendor/slim/slim/Slim/Middleware/RoutingMiddleware.php:76)","method":"GET","url":"http://xxx.execute-api.ap-southeast-1.amazonaws.com:443/img/logos/logo.jpg","referrer":""} []
I have enabled Standard logging on the S3 bucket (see serverless.yml configuration) but do not see anything relevant.
Description
While reviewing the Lambda logs of a server-side website construct, I see that certain requests which are usually correctly forwarded to static assets S3 bucket are sometimes forwarded to AWS Lambda. This obviously results in 404 errors.
For example:
I have enabled
Standard logging
on the S3 bucket (see serverless.yml configuration) but do not see anything relevant.How to Reproduce
constructs:
website:
type: server-side-website
certificate: ${self:custom.certificate.${self:provider.environment.ENV}}
domain: ${self:custom.websiteDomain.${self:provider.environment.ENV}}
redirectToMainDomain: ${self:custom.websiteRedirectToMainDomain.${self:provider.environment.ENV}}
assets:
'/js/': public/js
'/css/': public/css
'/fonts/': public/fonts/
'/pwa/': public/pwa/
'/img/*': public/img/
extensions:
distribution:
Properties:
DistributionConfig:
Logging:
Bucket: XXX-cloudfront-logs-bucket-${self:provider.environment.ENV}.s3.amazonaws.com
IncludeCookies: false
resources:
Resources:
Route53Records:
Type: AWS::Route53::RecordSetGroup
Properties:
HostedZoneId: ${self:custom.hostedZoneId.${self:provider.environment.ENV}}
RecordSets: ${self:custom.route53RecordSets.${self:provider.environment.ENV}}
CloudFrontLogsBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: XXX-cloudfront-logs-bucket-${self:provider.environment.ENV}
OwnershipControls:
Rules:
- ObjectOwnership: BucketOwnerPreferred
Additional Information
"serverless-lift": "^1.25"
The text was updated successfully, but these errors were encountered: