2 個答案
- 最新
- 最多得票
- 最多評論
0
Turns out that running the express app on API Gateway in a subfolder means I have to add the /prod prefix to the express get handler as /prod/blog*
已回答 2 年前
0
Your API Gateway is returning 301 redirects on requests for /blog to /blog/
Requests for /blog/ result in a 403 which I believe is the correct behavior. However, this isn't the case for (eg) /maps - that just returns a 403 immediately, not a redirect to /maps/
I think the problem is that CloudFront has cached the 301 response for /blog and is serving it for subsequent requests for /blog/
To solve this, the best option would be to remove the direct from /blog to /blog/ if possible. Once you've done that, you'll need to invalidate /blog in the CloudFront cache.
相關內容
- 已提問 10 個月前
- 已提問 6 個月前
- AWS 官方已更新 10 個月前
- AWS 官方已更新 2 年前
- AWS 官方已更新 1 年前
- AWS 官方已更新 2 年前
Thanks @Paul_L, you've hit on the crux of the problem. The express app I described returns the index.html file in all other implementations, but the API Gateway does not for some reason I can't figure out. You can see the index.html file is returned here (if you view source): https://wpreykda9j.execute-api.us-west-2.amazonaws.com/prod/blog/index.html