I have lambda in VPC and connect gateway to it. Also I add gateway url as second origin to cloudfront and create behaviour with /api/ path for this origin. But when I go to https://<cloudfront_url>/api/ I get {"message":"Not Found"} as response. But when I go to gateway url, I get Hello world as response.
My lamda code is a very simple "hello world" which i use to understand how lamda works:
exports.handler = async (event) => { const response = { statusCode: 200, body: JSON.stringify('Hello world') } return response }
My cloudfront configurations:
Does anyone have any ideas about it?


/api/? This configuration will try to access the API Gateway on this path not the root of