Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloudfront "Access Denied" when refreshing page outside of home page #456

Closed
rwave-fluentcommerce opened this issue Jun 29, 2023 · 2 comments · Fixed by #519
Closed

Cloudfront "Access Denied" when refreshing page outside of home page #456

rwave-fluentcommerce opened this issue Jun 29, 2023 · 2 comments · Fixed by #519
Assignees
Labels
bug Something isn't working

Comments

@rwave-fluentcommerce
Copy link

Hi team,

We've just recently deployed the latest stacks for the AWS retail demo store, and it looks great, however we notice that we can't refresh any pages outside of the home page.

Steps to reproduce:

  1. Deploy the Retail Demo Store to a new AWS account

  2. Browse to the generated url for the retail demo store
    image

  3. Browse to one of the featured products
    image

  4. Refresh the current page

Expected behaviour:

  1. Product page is reloaded successfully

Actual behaviour:

  1. An "Access Denied" error is shown to the user
    image

Note that this also happens on other pages - e.g if the auth page is refreshed.

@BastLeblanc
Copy link
Contributor

Hi!
Thanks for raising this, can you confirm that you are using a recent version of the Retail Demo Store? Was it a fresh install ?
We deployed large changes on moving to cloudfront https + api gateway, full on HTTPS recently (see PR #451)

Do you use the https cloudfront URL?

@gfaires
Copy link
Contributor

gfaires commented Jun 29, 2023

The issue is due to the frontend being a SPA. When you perform a request at the root / homepage, then CloudFront is configured to request the index.html. However, if you request any other path, then an attempt is made to retrieve the resource, which doesn't actually exist (it's just a route within the SPA).
You can configure the CloudFront distribution for the Web-ui to return a Customer Error Response:
HTTP Error Code: 403
Response Page path: /index.html
Http Response Code: 200

We'll look to have this pre-configured as part of deployment

@BastLeblanc BastLeblanc moved this to Backlog in Retail Demo Store Jun 29, 2023
@BastLeblanc BastLeblanc added the bug Something isn't working label Jul 18, 2023
@gfaires gfaires self-assigned this Nov 20, 2023
@github-project-automation github-project-automation bot moved this from Backlog to Working on it in Retail Demo Store Nov 20, 2023
@BastLeblanc BastLeblanc moved this from Working on it to Shipped in Retail Demo Store Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Shipped
Development

Successfully merging a pull request may close this issue.

3 participants