My scenario
I was just doing an upgrade of this Umbraco website from 8.4.0 to 8.6.4, everything went smoothly locally, but when it came to doing the upgrade on the live site, I saw a message like this:
The service is unavailable.
The url was as expected
https://codeshare.co.uk/install/?redir=true&url=https%3a%2f%2fcodeshare.co.uk%2f
But for some reason I was getting this weird error and I didn't know how to get past it.
It had to be something to do with the configuration I had on the production site that wasn't on the local one.
I did some googling and I found an issue in the Umbraco GitHub repo which seemed to describe my problem and I found a good solution in the comments.
So for anyone else who is searching for this now or myself searching for it again in 6 months, here was the code which solved it:
The solution
I just needed to add this line to the umbraco location path config setting in the main web.config file.
<httpErrors errorMode="Custom" existingResponse="PassThrough" />
Here it is with the rest of the code that is already in the file:
<location path="umbraco">
<system.webServer>
<urlCompression doStaticCompression="false" doDynamicCompression="false" dynamicCompressionBeforeCache="false" />
<httpErrors errorMode="Custom" existingResponse="PassThrough" />
</system.webServer>
</location>
The solution was to let the errors pass through. Who knew?
You can also do it for the install path:
<location path="install">
<system.webServer>
<urlCompression doStaticCompression="false" doDynamicCompression="false" dynamicCompressionBeforeCache="false" />
<httpErrors errorMode="Custom" existingResponse="PassThrough" />
</system.webServer>
</location>
Anyway I hope this helped you out in your hour of need.