Reputation: 11
I am using Visual studio 2017 default angular app. I have also installed DotNetCore.2.0.8-WindowsHosting.exe on local machine as well as remote server. I was able to deploy that to IIS on local machine, but when I copy Publish Profile (from bin\release\PublishOutput folder) to the remote server and connect it to IIS with No Managed code app pool setting, it throws below error (captured in Failed Request tracing)
<EventData> <Data Name="ContextId">{80000004-0002-E300-B63F-84710C7967BB}</Data> <Data Name="ModuleName">AspNetCoreModule</Data> <Data Name="Notification">128</Data> <Data Name="HttpStatus">502</Data> <Data Name="HttpReason">Bad Gateway</Data> <Data Name="HttpSubStatus">3</Data> <Data Name="ErrorCode">2147942413</Data> <Data Name="ConfigExceptionInfo"></Data> </EventData>
In fiddler Response Header is -
HTTP/1.1 502 Bad Gateway Content-Type: text/html Server: Microsoft-IIS/8.5 X-Powered-By: ASP.NET Date: Thu, 14 Jun 2018 17:33:23 GMT Content-Length: 1477
And error is -
502 - Web server received an invalid response while acting as a gateway or proxy server.
There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.
There are no errors found in Event Viewer. It says
Application 'MACHINE/WEBROOT/APPHOST/TEST' started process '6844' successfully and is listening on port '13118'.
Also, I am not able to capture the stdoutlogs
, somehow it's not registering. I have enabled it on web.config
file stdoutLogEnabled="true"
and given the permission to the logs folder at root directory to the specific app pool.
Upvotes: 0
Views: 693
Reputation: 11
I have installed DotNetCore.2.0.8-WindowsHosting.exe on server. Also, app works on local machine if accessed through IIS port but not with dotnet command (5000 port). With dotnet command it throws error locally and also on the server. But I am only looking to get it working with IIS on the server.
About FDD and SCD, which one is the standard practice for Angular SPA's?
I don't see nodejs on server at c:\program files. How do I package code with all dependencies? How do I even find out what I should be including in the package? This is my first Angular app, so sorry for basic questions.
My program.cs file -
public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.Build();
My web.config
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\testApp.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" requestTimeout="00:50:00">
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
</aspNetCore>
<tracing>
<traceFailedRequests>
<add path="*">
<traceAreas>
<add provider="ASPNET" areas="AppServices" verbosity="Verbose" />
<add provider="WWW Server" areas="Authentication,Security,Filter,StaticFile,CGI,RequestNotifications,Module,FastCGI,WebSocket,Rewrite,RequestRouting" verbosity="Verbose" />
</traceAreas>
<failureDefinitions statusCodes="401.3-600" />
</add>
</traceFailedRequests>
</tracing>
</system.webServer>
</configuration>
Upvotes: 0