在 AWS Amplify 上部署 React Web 应用程序时出现 403 ACCESS DENIED 错误 [英] Getting 403 ACCESS DENIED error when deploying React Web app on AWS Amplify

查看:37
本文介绍了在 AWS Amplify 上部署 React Web 应用程序时出现 403 ACCESS DENIED 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这几天一直在绞尽脑汁.我正在尝试在 AWS Amplify 上部署我的 React 应用程序.当我启动应用程序时,我被正确定向到登录页面(使用 Auth0 通用登录)登录后,我通过回调 URL 重定向回我的网络应用程序.

Been racking my brain on this for a couple of days. I am trying to deploy my react app on AWS Amplify. When I launch the application I am correctly directed to a sign in page (Uses Auth0 Universal login) After logging in I am redirected back to my web app through the callback URL.

当我的页面加载时,我收到以下消息

When my page loads I get the following message

此 XML 文件似乎没有任何相关的样式信息.文档树如下所示.

This XML file does not appear to have any style information associated with it. The document tree is shown below.

<Error>
<Code>AccessDenied</Code>

<Message>Access Denied</Message>

<RequestId>B2173BDEE0658858</RequestId>

<HostId>
TRevHdaqGZYTUxU9W1wXc3CQccfLeznHlYLcbuF+Wr511FVmOPFBp4tpyccJ2t5QMVpvYygNNb4=
</HostId>
</Error>

我没有通过 s3 存储桶托管 Web 应用程序,而是将我的构建文件直接上传到 AWS Amplify.

I am not hosting the web app through an s3 bucket, I uploaded my build file directly to AWS Amplify.

对问题是什么有什么想法吗?

Any ideas on what the issue is?

推荐答案

Use this rule on amplify console.
[
    {
        "source": "</^[^.]+$|\\.(?!(css|gif|ico|jpg|js|png|txt|svg|woff|ttf|map|json)$)([^.]+$)/>",
        "target": "/index.html",
        "status": "200",
        "condition": null
    }
]

这篇关于在 AWS Amplify 上部署 React Web 应用程序时出现 403 ACCESS DENIED 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆