How to Solve Received Invalid Status Code: 404 in the Backend Server’s HTTP Response

Azure. Ben Tsui 0 Reputation points
2024-10-18T08:01:52.1933333+00:00

Hi all, I try to set an application gateway for my Azure App Service. I follow the guideline in: https://zcusa.951200.xyz/en-us/azure/application-gateway/configure-web-app?tabs=customdomain%2Cazure-portal

After setting, there is an error in backend health.
Received invalid status code: 404 in the backend server’s HTTP response. As per the health probe configuration, 200-399 is the acceptable status code. Either modify probe configuration or resolve backend issues.

Does anyone know the cause? Thanks.

Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
1,081 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,821 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Deepanshukatara-6769 9,740 Reputation points
    2024-10-18T09:43:34.2666667+00:00

    Hello , Welcome to MS Q&A

    To resolve a 404 error in backend health for Azure Application Gateway, you should consider the following steps:

    1. Check Backend Server Configuration: Ensure that the backend server is correctly configured to handle the requests being sent by the Application Gateway. A 404 error typically indicates that the requested resource is not found on the server.
    2. Validate URL and Path: Confirm that the URL and path being probed by the Application Gateway are correct. If the path is incorrect or the resource does not exist, it will result in a 404 error.
    3. Inspect Application Gateway Settings: Review the settings of the Application Gateway, particularly the HTTP settings and the backend pool configuration. Ensure that the backend pool is pointing to the correct server and port.
    4. Check Health Probes: If you have configured custom health probes, verify that they are set up correctly and that they point to a valid endpoint on the backend server.
    5. Review Application Logs: Check the logs on the backend server to see if there are any indications of why the resource is not found. This may provide insights into misconfigurations or missing resources.

    By following these steps, you should be able to identify and resolve the issues causing the 404 error in backend health.

    References:

    Please do not modify probes as it is showing as expected instead follow above steps to resolve backend issues

    kindly accept if it helps and let us know if any further questions

    Thanks
    Deepanshu

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.