We're trying to add a service allowing premium users to have custom domains. In the first iteration this was supposed to be very simple: the user would add a CNAME record to an AWS API Gateway like https://xxxx111222333.execute-api.us-east-1.amazonaws.com, and a lambda function integration would check the original host, e.g. example-custom.com, and lookup in the database that this mapped to user bob-example
, then redirect to our-app-domain.com/bob-example
.
Whilst this isn't the most elegant solution, we wanted to test interest before going too heavy.
The problem is that API Gateway seems to have a limit of 120 custom domains. Whilst wildcard domains are possibly these do not help the above use case. If we asked the user to CNAME directly to the API gateway without adding the custom domain it seems to give a 403: forbidden
if those accessing the gateway directly does work oddly.
Similarly, Cloudfront has a limit of 100 CNAMEs, so I don't think this could work as a lambda edge function.
Just looking for some suggestions on how to solve this?
question from:
https://stackoverflow.com/questions/65930230/offering-custom-domains-via-a-redirect-issues-with-aws-api-gateway-quotas 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…