'AWS Api Gateway: Missing Authentication Token

So i have a Custom Domain Name setup for api gateway linked to a lambda function. I have it working fine if i do https://api_domain.com/something the behavior is as expected.

Resource: /{proxy+} Base Path Mappings: /

But when i go to the root domain and try to display something for that url i can't get it to work

https://api_domain.com/

{"message":"Missing Authentication Token"}

Searching around i found;

The "Missing Authentication Token" error might be happening if you aren't adding the resource to your uri. For me, browsing to https://{api_domain}/{stage} results in that error. If you do https://{api_domain}/{stage}/{resource_name} then the error may disappear.

Is there a way to display something custom for the root domain or is the only option to display that ugly error?



Solution 1:[1]

Add a method to the / root resource. As you have discovered the /{proxy+} doesn't match the root, you have to handle it separately.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 cementblocks