0
votes

I am trying to configure Azure application gateway WAF with a backendpool set to a VM in a different Azure tenant using its public IP address on port 443. All the SSL certificates are configured properly. However, I keep getting following error while browsing the site via WAF.

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

I have confirmed that NSG is on the mentioned backend VM is allowing all traffic on port 443. What could be going wrong here?

1
In case you’re using SSL offloading/termination at App gateway (which is pretty common).. then you’ll need to allow traffic thru port 80 (or whatever port you use)Rohit Saigal

1 Answers

1
votes

Generally, you can check the status of Backend health in the monitoring of Application Gateway and compare with the DETAILS referring to these possible reasons on your side.

  • 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.

For each reason, you can get a solution from that link. I think you could make sure you can directly access the backend with public IP from one tenant to another tenant. Then if you have an NSG in the app gateway subnet, you must include exceptions for incoming traffic on ports 65503-65534 for the Application Gateway v1 SKU, and ports 65200-65535 for the v2 SKU. You could get more details here. You could also whitelist the app gateway public IP address in the NSG of backend VM.