I was having this issue with my web app and I got it resolved by commenting out the redirect line:
On IIS, the allowAbsolutePathsWhenDelegated (on Configuration Editor --> system.webServer/httpErrors) was locked and I can't change the value false to true.