![](/img/trans.png)
[英]HTTP Error 500.19 - Internal Server Error after hosting the Angular 4 app
[英]HTTP Error 500.19 Internal Server Error after hosting angular 4 application in IIS
我知道我不是第一个在这里问这个问题的人,我可以找到很多与我的问题相关的解决方案,但没有解决我的问题。,
图片 :
网页配置
<system.webServer>
<rewrite>
<rules>
<rule name="AngularJS Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
</conditions>
<action type="Rewrite" url="/" />
</rule>
</rules>
</rewrite>
</system.webServer>
索引.html
<base href ="/eCommerceWebsite/">
IIS 中的物理路径
C:\eCommerceWebsite
谁能告诉我我在哪里犯了错误以及我需要在这里改变什么
编辑 :
图1:
图 2:
更新了 web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="AngularJS Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
</conditions>
<action type="Rewrite" url="/eCommerceWebsite" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
编辑2:
只是为了保持注册在这里。 您需要安装IIS URL Rewrite ,这是您的 < rewrite > 路由工作的 IIS 扩展。 这个扩展解决了我的 IIS 问题。
对于您的应用程序池,将“启用 32 位应用程序”设置为 true
现在转到 C: 驱动器,右键单击您的网站目录eCommerceWebsite ,然后单击安全性,然后进行编辑。
单击添加,然后在对象名称中您必须输入格式为“IIS AppPool{AppPoolName}”的 AppPool 标识用户,例如在屏幕截图中我有“IIS AppPool\\DefaultAppPool”作为 defaultAppPool。 接下来单击检查名称,然后分配“修改”权限。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.