Website with lambda and s3 bucket using serverless framework

What is the best practice of serverless of website that serves both lambda and s3?

We created a website hosting using serverless-domain-manager, that supports deploy multiple micro-services under the same domain

We used serverless-apigateway-service-proxy to hook the s3 to api gateway (and in turn to our website)

But something doesn’t seem to work properly (in S3 => API Gateway part)

  • Image fails to be rendered by the browser from ApiGateway while it is rendered successfully from s3 url - see links to both images below and try to open them in browser
https://y5f4ktp7lk.execute-api.us-east-1.amazonaws.com/dev/crs/Scorm1.2_HTML5/assets/toc/tocIcons/searchBtnNormal.png

https://c3-lat-crs-dev.s3.amazonaws.com/Scorm1.2_HTML5/assets/toc/tocIcons/searchBtnNormal.png
  • ApiGateway ignores Range header ("Range: bytes=0-") in request - it returns 200 instead of returning 206 and (might missing additional headers - we tried to tweak the ApiGateway from the AWS Console to return 206 and still the video failed to play through ApiGateway)

So it seems that this serverless-apigateway-service-proxy plugin is not behaving as pure proxy

  • is there an easy way to solve it?
  • what are the out-of-the-box alternatives to put s3 under a domain that already have lambdas attached to it? by out-of-the-box, I mean it would just proxy the s3 and return whatever status-code and headers the s3 returns