title: AWS API Gateway not working with custom domain
body: <p>I've created an expressjs api and hosted in AWS lambda with an api gateway for the same. It is working fine as expected with the url: </p>
  
  <blockquote>
    <p><a href="https://[api-id].execute-api.[region].amazonaws.com/prod/api/v1/todos" rel="noreferrer">https://[api-id].execute-api.[region].amazonaws.com/prod/api/v1/todos</a></p>
  </blockquote>
  
  <p>But I want to invoke it using a custom domain and I confgiured it using the custom domain option of the api gateway. I've registered my domain using google domains and I've added the CNAME entry in DNS configuration to map it to the cloudfront target domain name. So far so good. </p>
  
  <p><a href="https://i.stack.imgur.com/zRurN.png" rel="noreferrer"><img src="https://i.stack.imgur.com/zRurN.png" alt="enter image description here"></a></p>
  
  <p>The api gateway custom domain configuration is as follows with corresponding mappings.</p>
  
  <p><a href="https://i.stack.imgur.com/Gkx6f.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Gkx6f.png" alt="enter image description here"></a></p>
  
  <p>My problem is that I'm getting the message <code>Cannot GET /aprod/api/v1/todos</code>, on invoking with url: </p>
  
  <blockquote>
    <p><a href="https://apis.mydomain.com/aprod/api/v1/todos" rel="noreferrer">https://apis.mydomain.com/aprod/api/v1/todos</a></p>
  </blockquote>
  
  <p>and <code>forbidden</code> on</p>
  
  <blockquote>
    <p><a href="https://apis.mydomain.com/api/v1/todos" rel="noreferrer">https://apis.mydomain.com/api/v1/todos</a></p>
  </blockquote>
  
  <p>.</p>
  
  <p>My cloudwatch logs is as follows. If I'm not invoking with custom domain it works fine (green block), else no specific message (red block).</p>
  
  <p><a href="https://i.stack.imgur.com/kbE4X.png" rel="noreferrer"><img src="https://i.stack.imgur.com/kbE4X.png" alt="enter image description here"></a></p>
  
  <p>I've already spent two weekends on this issue, any help is much appreciated.</p>