Azure Application Gateway with API as a backend pool is not working

筅森魡賤 提交于 2020-04-18 05:55:10

问题


I have .net core API inside the web app and that web app is backend pool for azure application gateway. while trying to access the web app got below error.

"502 - Web server received an invalid response while acting as a gateway or proxy server."

On app GW, health prob for that web app in unhealthy but while access the API as a https://abc.azurewebsites.net/api/values then it works.


回答1:


When we deploy API in Web App Service then apiname.azurewebsites.net does not work give any probes to application gateway and treat unhealthy. API works like xxx.azurewebsites.net/api/values and Application Gateway also know this path. We have to put /api/values in override backend path of http settings. Same have to do in health probes.




回答2:


Yes, you can first verify if the backend API could access directly without app gateway. Then this error may happen due to the following main reasons:

  • NSG, UDR or Custom DNS is blocking access to backend pool members.
  • Back-end VMs or instances of virtual machine scale set are not responding to the default health probe.
  • Invalid or improper configuration of custom health probes.
  • Azure Application Gateway's back-end pool is not configured or empty.
  • None of the VMs or instances in virtual machine scale set are healthy.
  • Request time-out or connectivity issues with user requests.

Generally, the Backend healthy status and details could point it out and show some clues. You could also verify all of the above reasons one by one according to this DOC.



来源:https://stackoverflow.com/questions/55742331/azure-application-gateway-with-api-as-a-backend-pool-is-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!