我已经尝试了多次演练和 YouTube 视频,但仍然缺少一些东西。我使用 Azure DevOps 进行构建,并使用 Azure 应用服务进行部署。这些步骤至少可以部署我的代码,我可以从 Kudu DebugConsole 查看/site/wwwroot 中的所有内容。
我尝试创建一个 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?
关于azure - NextJS 和 Azure - "You do not have permission to view this directory or page.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64360694/