How to stop Azure IIS by adding an error status code line

I have the following setting in my web.config file for error handling:

<httpErrors errorMode="Custom" existingResponse="Replace"> <remove statusCode="500" /> <error statusCode="500" responseMode="ExecuteURL" path="/error/internalservererror/" /> </httpErrors> 

When I create an exception in my application, it works fine locally, but redirects it to the next URL of the page with the error in the azure region (note that the page where I selected the exception is at the end of the URL:

https://example.com/error/internalservererror/?500;https://example.com/error/internalservererror/?500;https://example.com/error/internalservererror/?500;https://example .com / error / internalservererror /? 500; https: //example.com/error/internalservererror/? 500; https: //example.com/error/internalservererror/? 500; https: //example.com/error/ internalservererror /? 500; https: //example.com/error/internalservererror/? 500; https: //example.com/error/internalservererror/? 500; https: //example.com/error/internalservererror/? 500; https://example.com/error/internalservererror/?500;https://example.com/error/internalservererror/?500;https://example.com/error/internalservererror/?500;https://example .com / error / internalservererror /? 500; https: //example.com/error/internalservererror/? 500; https: //example.com/error/internalservererror/? 500; https: //example.com/error/ internalservererror /? 500; https: //example.com/error/internalservererror/? 500; https: //example.com/error/internalservererror/? 500; https: //example.com/error/inter nalservererror /? 500; https: //example.com/error/internalservererror/? 500; https: //example.com/about/

How to stop IIS from applying this behavior in Azure?

+5
source share
1 answer

Just add a question mark at the end of your path parameter using your code, you will have something like this:

 <httpErrors errorMode="Custom" existingResponse="Replace"> <remove statusCode="500" /> <error statusCode="500" responseMode="ExecuteURL" path="/error/internalservererror/?" /> </httpErrors> 
+1
source

Source: https://habr.com/ru/post/1246807/


All Articles