当我收到错误时,在azure上托管angular 2 cli;您没有查看此目录或页面的权限。”;

当我收到错误时,在azure上托管angular 2 cli;您没有查看此目录或页面的权限。”;,angular,azure,hosting,Angular,Azure,Hosting,我正在学习angular 2,并尝试使用git在azure上托管一个应用程序。我对git一无所知。我只是跟着。我以前已经主持过一个简单的应用程序 在azure上推送我的应用程序后,我发现了错误 您没有查看此目录或页面的权限 我正在使用angular cli,因此无法按照stackoverflow上其他答案的建议找到web.config。如何配置关于设置其他环境(如angular2 cli),在那里我找不到web.config好吧,您可以查看@stas.ivash的答案,在中找到web.confi

我正在学习angular 2,并尝试使用git在azure上托管一个应用程序。我对git一无所知。我只是跟着。我以前已经主持过一个简单的应用程序

在azure上推送我的应用程序后,我发现了错误

您没有查看此目录或页面的权限


我正在使用angular cli,因此无法按照stackoverflow上其他答案的建议找到web.config。如何配置关于设置其他环境(如angular2 cli),在那里我找不到web.config

好吧,您可以查看@stas.ivash的答案,在中找到
web.config
文件

<rewrite>
    <rules>
        <rule name="redirect all" stopProcessing="true">
            <match url="^(.*)$" ignoreCase="false" />
            <conditions logicalGrouping="MatchAll">
                <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" pattern="" ignoreCase="false" />
            </conditions>
            <action type="Rewrite" url="PATH TO INDEX.HTML" appendQueryString="true" />
        </rule>
    </rules>
</rewrite>
Angular 2默认使用HTML5路由,您要么必须映射所有 通过将以下内容添加到web.config,服务器请求index.html

<rewrite>
    <rules>
        <rule name="redirect all" stopProcessing="true">
            <match url="^(.*)$" ignoreCase="false" />
            <conditions logicalGrouping="MatchAll">
                <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" pattern="" ignoreCase="false" />
            </conditions>
            <action type="Rewrite" url="PATH TO INDEX.HTML" appendQueryString="true" />
        </rule>
    </rules>
</rewrite>


此错误与服务器和文件夹权限有关。感谢您的回复。但从我阅读答案后的理解来看,我发现web.config文件位于网站的根文件夹中。但我在angular 2应用程序中找不到任何这些文件(我也在使用angular cli)。因此,请提供详细答案。谢谢您只需将web.config文件放入
/dist
文件夹,然后将其推送到远程存储库。