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