0
votes

I have the following setup on Azure

Public internet <--> Application gateway <--> App service

I now have a weird issue where the very first request that hits the Application gateway returns "502 - Web server received an invalid response while acting as a gateway or proxy server.". And then if I try the same url again by refreshing the page, the page loads fine.

I had a look at the application logs in my app service but coudln't find anything that would cause the app gateway to return 502. So now I need to know what exactly the gateway is sending to the app service, and what exact response the gateway is getting from the app service that would cause only the first request to fail.

How would i view the http requests that were transmitted between the gateway and app service?

1

1 Answers

0
votes

The following article details how to enable web server logging on an Azure App Service which will log raw HTTP request data in the W3C extended log format:

https://docs.microsoft.com/en-us/azure/app-service/troubleshoot-diagnostic-logs