Closed mbklein closed 2 years ago
This issue cannot be fixed automatically. serverless-iiif
already supports overriding the domain name two different ways:
forceHost
environment variable to the desired hostnamex-forwarded-host
header from CloudFrontBoth of these methods are already working correctly in the code. The problem is that:
x-forwarded-host
headerforceHost
variableThe only ways to get this working at the moment would be:
forceHost
environment variable on the lambda or add an x-forwarded-host
header to the lambda origin on the CloudFront distribution, with the value being the domain name of the CloudFront distributionHost
header to x-forwarded-host
forceHost
)None of these is a perfect solution to the problem, especially since every redeploy/update will wipe out the manual configuration. It might be possible to store the lambda function's configuration somewhere else (like in Parameter Store or Secrets Manager), which would make this easy. But then we'd incur the overhead of fetching the configuration on every invocation.
Description
When accessed through CloudFront, the
@id
field of theinfo.json
file is using the standalone function URL as the base instead of the CloudFront domain URL.Done Looks Like
@id
is correct when accessed via standalone or CloudFront