2 個答案
- 最新
- 最多得票
- 最多評論
0
Try changing the path pattern to "path/*".
Perhaps the "/" at the beginning of the "/" is used to route to secondary when accessing with "/".
Also, the secondary S3 directory structure should be such that the contents are placed under "path/".
CloudFront does not ignore paths that match the path set in the Path Pattern when they are sent to Origin, but includes the path in the Path Pattern.
Therefore, if there is no content under "path/" in the secondary S3, an error will occur.
0
Thanks. I didn't need to remove the "/" in front of "/path/*".
Instead, there were 2 things I had to do:
- The secondary website had to have the website deployed to a "/path" subfolder inside the bucket. In my case, my website was a React app. To use the new path and ensure all referencing paths were set properly, I had to add this to my package.json:
"homepage": "http://mywebsite.com/path"
- When referencing the secondary website, I had to add the trailing slash
https://example.com/path/
. This didn't work:https://example.com/path
已回答 10 個月前
相關內容
- AWS 官方已更新 1 年前
- AWS 官方已更新 9 個月前
- AWS 官方已更新 10 個月前
- AWS 官方已更新 2 年前