简体   繁体   English

Angular IIS 上的通用部署

[英]Angular Universal Deployment on IIS

I have converted my angular9 Application to Angular Universal and now i want to deploy on IIS server.This works fine when i add a site but whe i add a application in DEfault Web Site of IIS this shows following error. I have converted my angular9 Application to Angular Universal and now i want to deploy on IIS server.This works fine when i add a site but whe i add a application in DEfault Web Site of IIS this shows following error. Images are here.图像在这里。 [1]: https://i.stack.imgur.com/ksWw2.png [2]: https://i.stack.imgur.com/Jk27S.png [1]: https://i.stack.imgur.com/ksWw2.png [2]: https://i.stack.imgur.com/Jk27S.png

It is obviously that you are running an incorrect rewrite rule for your application.很明显,您正在为您的应用程序运行不正确的重写规则。 When the rule can't rewrite your extensionless URL, then IIS static file handler will handle it.当规则无法重写您的无扩展 URL 时,IIS static 文件处理程序将处理它。

If you enable failed request tracing, then you may notcie that如果您启用失败的请求跟踪,那么您可能会注意到

在此处输入图像描述

its input match is blank"" instead of /appraisal.它的输入匹配是空白"" 而不是 /appraisal。

So if main.js is placed in appraisal/server/所以如果main.js放在了appearance/server/

Then please try this rule那么请试试这个规则

 <rule name="rewrite rule">
                    <match url=".*" />
                    <action type="Rewrite" url="server/main.js" />
                    <conditions>
                        <add input="{URL}" pattern="^/appraisal/*" />
                    </conditions>
                </rule>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM