5

I realize posts like this exist, I've read/re-read and am still having issues. Most are old or not directly related and so I thought I'd re-post w/a current example.

Trying to get a basic site running in IIS 8.5+ on win server 2012 R2. At this point I'm stuck at "502.3 - Bad Gateway" (error code 80070002, module httpPlatformHandler, notification executeRequestHandler, handler httpplatformhandler)

Relevant info:

  • dnx 1.0.0-rc1-final clr (x64)
  • IIS - installed/verified HttpPlatformHandler 1.2 is installed (v1.2.1959)
  • IIS - setup a "No Managed Code" pool/site
  • On the server itself I can get the site to show up if i run the "kestrel.cmd" (generated via dnu publish) directly, from the command line and navigate to the site.
    • Project.json:
{
  "version": "1.0.0-*",
  "dependencies": {
    "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
    "Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
    "Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final"
  },
  "commands": {
    "kestrel": "Microsoft.AspNet.Server.Kestrel"
  },
  "frameworks": {
    "dnx451": {}
  },
  "publishExclude": [
    "node_modules",
    "bower_components",
    "**.xproj",
    "**.user",
    "**.vspscc"
  ],
  "exclude": [
    "www",
    "node_modules",
    "bower_components"
  ],
  "scripts": {
    "prepublish": [
      "npm install",
      "bower install"
    ]
  }
}
  • Web.config generated after dnu publish:
<configuration>
  <system.webServer>
    <handlers>
      <add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
    </handlers>
    <httpPlatform processPath="approot\kestrel.cmd" arguments="" stdoutLogEnabled="true" stdoutLogFile="logs\stdout.log" forwardWindowsAuthToken="false" startupTimeLimit="3600"></httpPlatform>
  </system.webServer>
</configuration>

Your help is much appreciated.

DavidG
  • 113,891
  • 12
  • 217
  • 223
jd314159
  • 365
  • 2
  • 14
  • Did you copied the wwwroot and approot folders to your website folder on IIS? You must copy both folders with their contents and not wwwroot content – Miguel Moura Dec 04 '15 at 22:08
  • 1
    Are you hosting the site on a Virtual Directory? – Miguel Moura Dec 04 '15 at 22:13
  • how is Your IIS site configured? by default, you should have two folders: `wwwroot` and `approot`. `Physical Path` in IIS should point to `wwwroot` directory, which contains `web.config`. In that case, `processPath` in `httpPlatform` should rather be `..\approot\kestrel.cmd`. – qbik Dec 07 '15 at 12:52
  • I changed a few things and finally got it to work. Not sure which one was the ticket but probably all in combo. I had some hardcoded ports in my code/json which i removed (e.g. kestrel command...). One of my default commands (e.g. "web") that gets generated from the publish was using WebListener. I removed that in favor of Kestrel instead. I originally copied everything from wwwroot up to the root web dir and changed the generated web.config accordingly. Instead I now left the wwwroot files where they were and just changed the physical dir in IIS. Thanks much for the help. – jd314159 Dec 07 '15 at 17:12
  • I hope my comment on this GitHub topic helps:https://github.com/aspnet/Hosting/issues/466#issuecomment-168372853 – Jijie Chen Jan 02 '16 at 08:21
  • I'm voting to close this question as "a problem that can no longer be reproduced". ASP.NET Core 1.0 has been released and publishing process now is different one. See https://docs.asp.net/en/latest/publishing/index.html?highlight=publishing – Set Aug 10 '16 at 09:10

1 Answers1

0

I was getting the same issue - iis 8 - bad gateway 502.3.

I went to Turn Windows Features On or Off and enabled IIS.

I cleaned and rebuild the solution and it ran like a charm.

I hope it helps you too.

Abhay Shiro
  • 3,431
  • 2
  • 16
  • 26