Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web.Config ... <HttpErrors> does not work in Azure WebSite/WebApp #82

Closed
BishoyDemian opened this issue Mar 26, 2016 · 5 comments
Closed
Labels
bug Issues describing a bug or pull requests fixing a bug.

Comments

@BishoyDemian
Copy link

Thanks for this great project .. it saved me a good amount of time setting it all up myself.

I recently started using the template and it works great on my machine and IIS. However, when I deployed a version to an Azure WebApp, I started getting an infinite redirect loop for any bad URL.

I did some debugging, and I found that the httpErrors config section does not work as expected in Azure WebApps and instead the CustomErrors section should be used.

@RehanSaeed
Copy link
Member

Let me take a look...

@RehanSaeed RehanSaeed added the bug Issues describing a bug or pull requests fixing a bug. label Apr 10, 2016
@RehanSaeed
Copy link
Member

It works on a local IIS but not on Azure. There are some indications that the httpErrors section in Web.config does not work on Azure. I've spent the last hour trying different things without much luck so far.

I've raised this question and put a bounty on this one.

@BishoyDemian
Copy link
Author

What I ended up doing is removing the httpErrors section completely and
using CustomErrors instead. it works reliably on bothe, IIS and Azure
WebApps

On 10 April 2016 at 17:51, Muhammad Rehan Saeed notifications@github.com
wrote:

It works on a local IIS but not on Azure. There are some indications that
the httpErrors section in Web.config does not work on Azure. I've spent the
last hour trying different things without much luck so far.

I've raised this
https://stackoverflow.com/questions/36527026/how-to-stop-azure-iis-appending-error-status-code-query-string
question and put a bounty on this
https://serverfault.com/questions/586875/iis-httperrors-executeurl-appends-weird-query-string-like-500http-mysite-com
one.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#82 (comment)

@RehanSaeed
Copy link
Member

RehanSaeed commented Apr 17, 2016

Can you please post the fragment of config you used to get it working? I'm not sure how to handle this. Probably add it in commented out with a message to uncomment if using Azure?

@BishoyDemian
Copy link
Author

Hi Rehan, sorry for the late reply. was a bit busy here.

here is the fragment I changed after removing

<customErrors mode="On" defaultRedirect="~/error/generic.html">
  <error statusCode="400" redirect="/error/badrequest/" />
  <error statusCode="401" redirect="/error/unauthorized/" />
  <error statusCode="403" redirect="/error/forbidden.html" />
  <error statusCode="404" redirect="/error/notfound/" />
  <error statusCode="405" redirect="/error/methodnotallowed/" />
  <error statusCode="500" redirect="error\serviceunavailable.html" />
  <error statusCode="503" redirect="error\serviceunavailable.html" />
  <error statusCode="504" redirect="error\gatewaytimeout.html" />
</customErrors>

On 17 April 2016 at 19:27, Muhammad Rehan Saeed notifications@github.com
wrote:

Can you please post the fragment of config you used to get it working?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#82 (comment)

@RehanSaeed RehanSaeed moved this from To Do to Done in ASP.NET 4.6 MVC 5 Apr 26, 2018
@RehanSaeed RehanSaeed removed this from Done in ASP.NET 4.6 MVC 5 Apr 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues describing a bug or pull requests fixing a bug.
Projects
None yet
Development

No branches or pull requests

2 participants