AWS Amplify is returning 403 error only when a "location" query param is specified

Viewed 589

I have a site hosted with AWS Amplify, and every URL that has a location query parameter returns something like:

403 Forbidden

<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>THSG05EH8EYB1E7N</RequestId>
<HostId>n6Ycon+6kmnmIMiH47lLxNiXhXduG4QzJstmzNeEfBYy3AV19PisdKfXHN99LIAE2cZgvLJ1FBQ=</HostId>
</Error>

Suppose my site is: https://example.com

Access to:

https://example.com --> works
https://example.com?anyotherparam=anyvalue --> works
https://example.com/ --> works
https://example.com/anyurl --> works
https://example.com/anyurl?anyotherparam=anyvalue --> works
https://example.com/any/sub/url -> works
https://example.com/any/sub/url?anyotherparam=anyvalue -> works
https://example.com?location --> returns 403
https://example.com?location?anyvalue --> returns 403
https://example.com/anyurl?location --> returns 403
https://example.com/anyurl?location=anyvalue --> returns 403
https://example.com/any/sub/url?location --> returns 403
https://example.com/any/sub/url?location=anyvalue --> returns 403

Any idea what can cause this?

Edit: I don't know if related... but in Amplify redirects, I configured the AWSDoc recommended redirect for SPAs rule:

Address: </^[^.]+$|\.(?!(css|gif|ico|jpg|js|png|txt|svg|woff|ttf|map|json)$)([^.]+$)/>
DestinationAddress: /index.html
RedirectType: 200
1 Answers
Related