Application gateway - 404 while invoking backend service (Linux app service)

Yuriy Shkraba 1 Reputation point
2022-11-23T12:30:44.74+00:00

I have a problem with configuring the Application gateway. I have 2 app services that are hosted on Linux.

Frontend
Backend
I would like to configure the next behavior:

When the user types in URL -> mysite.com - redirect to the Frontend

When the user types in URL -> mysite.com/api - redirect to the Backend

My configured Rules
263471-cx4ou.png

On Windows app services we have "Virtual applications and directories" that can fix an issue like this:
263481-dkaox.png
But the Linux app service does not have this option.
This is not helped me https://learn.microsoft.com/en-us/answers/questions/239472/application-gateway-result-in-http-error-code-404.html

Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
956 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,874 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. msrini-MSFT 9,256 Reputation points Microsoft Employee
    2022-11-23T17:46:44.77+00:00

    Hi,

    404 is page not found. Can you enable diagnostic logs for Application Gateway and check if you can find the request that is sent to the backend and the 404 response?

    Or you can capture logs from backend Linux App service and check what is the request that hits for which App Service returned 404.

    That way, you can make changes the App GW and modify the request headers or path and get it forwarded to the App Service.

    Regards,
    Karthik Srinivas