azure - NextJS 和 Azure - "You do not have permission to view this directory or page."

标签 azure next.js

我已经尝试了多次演练和 YouTube 视频,但仍然缺少一些东西。我使用 Azure DevOps 进行构建,并使用 Azure 应用服务进行部署。这些步骤至少可以部署我的代码,我可以从 Kudu DebugConsole 查看/site/wwwroot 中的所有内容。

enter image description here

我尝试创建一个 server.js 文件来正确设置端口: https://github.com/willemliu/fd-design-system-test/blob/master/server.js

我在根目录中包含了一个 web.config 以指向此 server.js 文件: https://github.com/MRCollective/nextjs-server-azuresiteextension/blob/master/Next.js/files/web.config

但无论我尝试什么,我总是看到此权限错误。有人有什么建议吗?

解决方案!

问题出在我的 web.config 上。我把它换成了这个,现在一切正常了。 https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config

最佳答案

大多数情况下,您可能会遇到此问题,因为虚拟路径 -> 物理路径映射不正确。请检查虚拟路径映射是否正确。

https://learn.microsoft.com/en-us/azure/app-service/configure-common

这里回答了类似的问题。请看一下并希望它有所帮助。 Azure website message "You do not have permission to view this directory or page.". What to do?

Path Mapping

关于azure - NextJS 和 Azure - "You do not have permission to view this directory or page.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64360694/

相关文章:

visual-studio - 运行 (F5) 项目时 Azure 云服务出错

c# - 无法从 Azure 网站访问 SQL Azure DB,但相同的连接字符串可以从本地网站访问

c++ - 无法在生产环境中加载 Nikons Raw SDK

c# - 如何将azure数据库导出到blob存储

azure - 通过 REST API 的 Cosmos DB IN 子句

reactjs - 无法读取 nextJs 中 razorpay 付款的 null 属性 'tagName'

next.js - NextJS 的 getServerSideProps 中的 Apollo 查询?

firebase - 如何在next.js中重定向到受限页面的登录页面?

typescript - 使用 Typescript 的 Shopify CLI

javascript - 最小 `_app.js` 替换而不改 rebase 本行为